Shlutka
By:
Shlutka

Help Setting Up mySQL Database

March 7, 2015 1.7k views
MySQL

So I run a minecraft server network called GulchNetwork. I am currently setting up a vote for coins system, with the coins, players are able to purchase in-game items/ranks throughout any of the gamemodes. Each gamemode has it's own server, so obviously each server would need to get its information on how many coins each player has from a mySQL database. I'm a noob with this though, this is my first time setting one up. I have bought a droplet, I have set this in the config file of the plugin I'm using (NetworkCoins).

MySQL:
Host: (the droplet ip)
Port: 3306
DbName: network_coins
Username: root
Password: (root password, correct)

I have everything filled out correctly, put the plugin gets this error.
07.03 04:39:21 [Server] WARN at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
07.03 04:39:21 [Server] WARN at me.josh.networkcoins.NetworkCoins.onEnable(NetworkCoins.java:72)
07.03 04:39:21 [Server] WARN at me.josh.networkcoins.NetworkCoins.openConnection(NetworkCoins.java:98)
07.03 04:39:21 [Server] WARN at java.sql.DriverManager.getConnection(Unknown Source)
07.03 04:39:21 [Server] WARN at java.sql.DriverManager.getConnection(Unknown Source)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
07.03 04:39:21 [Server] WARN at java.lang.reflect.Constructor.newInstance(Unknown Source)
07.03 04:39:21 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
07.03 04:39:21 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
07.03 04:39:21 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2334)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
07.03 04:39:21 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
07.03 04:39:21 [Server] WARN at java.lang.reflect.Constructor.newInstance(Unknown Source)
07.03 04:39:21 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
07.03 04:39:21 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
07.03 04:39:21 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
07.03 04:39:21 [Server] INFO The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
07.03 04:39:21 [Server] WARN com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
07.03 04:39:19 [Server] INFO Successfully registered /coins as your custom command
07.03 04:39:19 [Server] INFO Enabling NetworkCoins v0.5

If anybody could please help me with this, it would be greatly appreciated, for this is high priority for my server network.

1 comment
1 Answer

Hey there,

Normally MySQL listens on 127.0.0.1 by default for security purposes. It does not listen on the Droplet IP unless you change the bind-address to 0.0.0.0 to listen on all interfaces in the /etc/my.cnf file.

Happy coding,

Jon Schwenn
Platform Support Specialist
DigitalOcean

Have another answer? Share your knowledge.