Error
Tikkle opened this issue ยท 16 comments
I've tried nearly everything. I don't know how to really set-up a database. I was wondering if you had a really in-depth tutorial.
[11:29:25] [Server thread/WARN]: [BanManager] An error occurred attempting to make a database connection, please see stack trace below
[11:29:25] [Server thread/INFO]: [BanManager] Disabling BanManager v5.6.1
[11:29:25] [Server thread/INFO]: 2015-10-04 11:29:25,636 [DEBUG] JdbcPooledConnectionSource closing
[11:29:25] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 10 times. Giving up.
[11:29:25] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[11:29:25] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2239)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2168)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:794)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
[11:29:25] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[11:29:25] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
[11:29:25] [Server thread/WARN]: at java.sql.DriverManager.getConnection(Unknown Source)
[11:29:25] [Server thread/WARN]: at java.sql.DriverManager.getConnection(Unknown Source)
[11:29:25] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.jdbc.JdbcConnectionSource.makeConnection(JdbcConnectionSource.java:252)
[11:29:25] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.jdbc.JdbcPooledConnectionSource.getReadWriteConnection(JdbcPooledConnectionSource.java:136)
[11:29:25] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.jdbc.JdbcPooledConnectionSource.getReadOnlyConnection(JdbcPooledConnectionSource.java:111)
[11:29:25] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.isTableExists(BaseDaoImpl.java:689)
[11:29:25] [Server thread/WARN]: at me.confuser.banmanager.storage.PlayerStorage.(PlayerStorage.java:40)
[11:29:25] [Server thread/WARN]: at me.confuser.banmanager.BanManager.setupStorages(BanManager.java:404)
[11:29:25] [Server thread/WARN]: at me.confuser.banmanager.BanManager.onEnable(BanManager.java:125)
[11:29:25] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
[11:29:25] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:335)
[11:29:25] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405)
[11:29:25] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugin(CraftServer.java:355)
[11:29:25] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R1.CraftServer.enablePlugins(CraftServer.java:315)
[11:29:25] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.q(MinecraftServer.java:402)
[11:29:25] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.k(MinecraftServer.java:370)
[11:29:25] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.a(MinecraftServer.java:325)
[11:29:25] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:211)
[11:29:25] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:494)
[11:29:25] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)
[11:29:25] [Server thread/WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'localbans'
[11:29:25] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[11:29:25] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:931)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4031)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1296)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2338)
[11:29:25] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2186)
[11:29:25] [Server thread/WARN]: ... 30 more
MySQLSyntaxErrorException: Unknown database 'localbans'
Double check that the name of the database is correct both in MySQL as well as your config.yml
. This is case sensitive.
You generally should use lowercase characters only. There is no standard through all plugins out there. Some are case sensitive, some are not and others even forcing lowercase.
in the console it seems that it forces the name of the database to all lowercase.
Also, im using MySQL Community. When i click on my database it shows this:
LocalBans
minecraft
127.0.0.1:3306
Give me one sec, i just changed it, it's now re-booting
EDIT: It still doesn't work.
enabled: true
host: 127.0.0.1
port: 3306
name: localbans
user: minecraft
password: ****
Did you properly grant all necessary privileges TO 'minecraft'@'localhost' IDENTIFIED BY '****';
?
If you have a GUI to manage your MySQL databases like phpMyAdmin you don't need this part of a command. Just use google for a tutorial to grant a particular user all privileges for a particular database.
If you don't have something like that you have to do this by command like. You may ask your system administrator to do that for you.
I just flushed the system with
GRANT ALL PRIVILEGES ON dbname.* TO minecraft@'localhost' IDENTIFIED BY '****';
FLUSH PRIVILEGES;
Your dbname
should be localbans
I guess?
Did you try to access with the mysql command line using the user minecraft
and create a table at localbans
?
it worked for the granted. but when i booted it up i still got this:
[12:50:04] [Server thread/WARN]: [BanManager] An error occurred attempting to make a database connection, please see stack trace below
[12:50:04] [Server thread/INFO]: [BanManager] Disabling BanManager v5.6.1
[12:50:04] [Server thread/INFO]: 2015-10-04 12:50:04,173 [DEBUG] JdbcPooledConnectionSource closing
[12:50:04] [Server thread/WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 10 times. Giving up.
[12:50:04] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[12:50:04] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2239)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2168)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:794)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
[12:50:04] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[12:50:04] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
[12:50:04] [Server thread/WARN]: at java.sql.DriverManager.getConnection(Unknown Source)
[12:50:04] [Server thread/WARN]: at java.sql.DriverManager.getConnection(Unknown Source)
[12:50:04] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.jdbc.JdbcConnectionSource.makeConnection(JdbcConnectionSource.java:252)
[12:50:04] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.jdbc.JdbcPooledConnectionSource.getReadWriteConnection(JdbcPooledConnectionSource.java:136)
[12:50:04] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.jdbc.JdbcPooledConnectionSource.getReadOnlyConnection(JdbcPooledConnectionSource.java:111)
[12:50:04] [Server thread/WARN]: at me.confuser.banmanager.internal.ormlite.dao.BaseDaoImpl.isTableExists(BaseDaoImpl.java:689)
[12:50:04] [Server thread/WARN]: at me.confuser.banmanager.storage.PlayerStorage.(PlayerStorage.java:40)
[12:50:04] [Server thread/WARN]: at me.confuser.banmanager.BanManager.setupStorages(BanManager.java:404)
[12:50:04] [Server thread/WARN]: at me.confuser.banmanager.BanManager.onEnable(BanManager.java:125)
[12:50:04] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
[12:50:04] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:335)
[12:50:04] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405)
[12:50:04] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugin(CraftServer.java:355)
[12:50:04] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R1.CraftServer.enablePlugins(CraftServer.java:315)
[12:50:04] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.q(MinecraftServer.java:402)
[12:50:04] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.k(MinecraftServer.java:370)
[12:50:04] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.a(MinecraftServer.java:325)
[12:50:04] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:211)
[12:50:04] [Server thread/WARN]: at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:494)
[12:50:04] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)
[12:50:04] [Server thread/WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'minecraft'@'localhost' to database 'localbans'
[12:50:04] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[12:50:04] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:382)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:931)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4031)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1296)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2338)
[12:50:04] [Server thread/WARN]: at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2186)
[12:50:04] [Server thread/WARN]: ... 30 more
MySQLSyntaxErrorException: Access denied for user 'minecraft'@'localhost' to database 'localbans'
minecraft
is not allowed to access your MySQLd.
Try
grant usage on *.* to 'minecraft'@'localhost' identified by '****';
Wait, i changed it to
grant usage on localhost.* to 'minecraft'@'localhost' identified by '****';
and it worked
Testing it now.
If you have a GUI to manage your MySQL databases like phpMyAdmin you don't need this part of a command. Just use google for a tutorial to grant a particular user all privileges for a particular database.
If you don't have something like that you have to do this by command like. You may ask your system administrator to do that for you.
My dad understands this, we will try it and get back to you.