Problems with connecting to MySQL database

Discussion in 'Spigot Plugin Development' started by Realm, Apr 27, 2017.

  1. Im having an issue with connecting to a mysql database... I have full perms to it, but havnt queried anything manually yet, everything is default on the phpmyadmin site.
    My error is this:
    Code (Text):
    Failed to connect to [jdbc:mysql://ip/phpmyadmin:3306/teamsbans] using mysql driver.
    first time Im trying to connect to an externally hosted database... ;/
     
  2. We can't help you unless you provide the code..
     
  3. Looks like you're trying to put a URL instead if ip.
    Code (Text):
    jdbc:mysql://ip/phpmyadmin:3306/teamsbans
    Should be
    Code (Text):
    jdbc:mysql://123.123.123.123:3306/teamsbans
    But obviously use the right ip.

    The problem is / is a special character in this line to parse specific sections. Inserting a URL will not work. The protocol doesn't care about phpmyadmin.
     
  4. See the thing is, the ip, say 123.123.123.123, that points to the forums
    however, 123.123.123.123/phpmyadmin points to the phpmyadmin where the sql data bases are stored. Also, the code is correct, its what Im inserting in as the values that are incorrect
     
  5. You're not understanding. Phpmyadmin is a website on Port 80. Its a simple web interface to visually manage mysql databases. That's all.

    MySQL is a completely different service with a different protocol that runs on port 3306.

    Bukkit only needs the IP and port.

    While you, as a human, use phpmyadmin to interface easily with mysql.. Bukkit needs to interface directly to mysql without any middlemen like phpmyadmin in the way.

    To put things differently, let's say you always use your mother to give you a ride to the store. Now, your friend wants to go to the store you go to, too. So he asks you to tell him where the store is and what vehicle to use in a specific format of location/vehicle. You answer him with mainStreet/mom's/car because you always use mom to drive you. Well, that's a problem because now your friend is going to ride your mom to the store. Next thing you know your friend moves in and becomes your step dad. Not entirely what you hoped for, all because you failed to provide the instructions properly as expected.

    That's exactly what bukkit is doing when you throw phpmyadmin in there. It's getting the instructions all mixed up and who knows what it's trying to do. Maybe connect to ip on Port phpmyadmin. Maybe ip on Port 3306 but database named phpmyadmin. Who knows :p
     
    #5 BillyGalbreath, Apr 27, 2017
    Last edited: Apr 27, 2017
    • Creative Creative x 1