CraftConomy

154k Downloads

All parts of a PRIMARY KEY must be NOT NULL?

FunkyNico opened this issue ยท 3 comments

commented

Hello,

Whenever I start my server I get this error:

04.01 13:01:39 [Server] INFO [Craftconomy3] Enabling Craftconomy3 v3.3.1-d99cf63-trv200 04.01 13:01:39 [Server] INFO [Craftconomy3] Starting up! 04.01 13:01:39 [Server] INFO [Craftconomy3] Loading the Configuration 04.01 13:01:39 [Server] INFO [Craftconomy3] Loading listeners. 04.01 13:01:39 [Server] INFO [Craftconomy3] Loading commands 04.01 13:01:39 [Server] INFO [Craftconomy3] Cargando el Administrador de la base de Datos 04.01 13:01:39 [Server] WARN SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 04.01 13:01:39 [Server] WARN SLF4J: Defaulting to no-operation (NOP) logger implementation 04.01 13:01:39 [Server] WARN SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 04.01 13:01:39 [Server] WARN com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead 04.01 13:01:39 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 04.01 13:01:39 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 04.01 13:01:39 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 04.01 13:01:39 [Server] WARN at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.Util.getInstance(Util.java:408) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2487) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104) 04.01 13:01:39 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998) 04.01 13:01:39 [Server] WARN at com.greatmancode.com.zaxxer.libs.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) 04.01 13:01:39 [Server] WARN at com.greatmancode.com.zaxxer.libs.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) 04.01 13:01:39 [Server] WARN at com.greatmancode.craftconomy3.storage.sql.MySQLEngine.<init>(MySQLEngine.java:83) 04.01 13:01:39 [Server] WARN at com.greatmancode.craftconomy3.storage.StorageHandler.<init>(StorageHandler.java:40) 04.01 13:01:39 [Server] WARN at com.greatmancode.craftconomy3.Common.initialiseDatabase(Common.java:397) 04.01 13:01:39 [Server] WARN at com.greatmancode.craftconomy3.Common.onEnable(Common.java:144) 04.01 13:01:39 [Server] WARN at com.greatmancode.craftconomy3.tools.interfaces.BukkitLoader.onEnable(BukkitLoader.java:49) 04.01 13:01:39 [Server] WARN at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) 04.01 13:01:39 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) 04.01 13:01:39 [Server] WARN at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) 04.01 13:01:39 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) 04.01 13:01:39 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) 04.01 13:01:39 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) 04.01 13:01:39 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) 04.01 13:01:39 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) 04.01 13:01:39 [Server] WARN at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) 04.01 13:01:39 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) 04.01 13:01:39 [Server] WARN at java.lang.Thread.run(Thread.java:748)

https://pastebin.com/aBxL4FJS

I don't know what to do.

This is my config:

https://pastebin.com/3zysmRZi

Thanks.

commented

I created a fork and fixed this problem occurring on MySQL 5.7. You can download a compiled binary here: Link

commented

Hello, i'm getting this error now:

13.02 02:02:26 [Server] WARN [Server thread] INFO com.greatmancode.com.zaxxer.libs.hikari.HikariDataSource - HikariPool-0 - is starting. 13.02 02:02:26 [Server] WARN java.sql.SQLException: Cannot add foreign key constraint 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104) 13.02 02:02:26 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998) 13.02 02:02:26 [Server] WARN at com.greatmancode.com.zaxxer.libs.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) 13.02 02:02:26 [Server] WARN at com.greatmancode.com.zaxxer.libs.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) 13.02 02:02:26 [Server] WARN at com.greatmancode.craftconomy3.storage.sql.MySQLEngine.<init>(MySQLEngine.java:87) 13.02 02:02:26 [Server] WARN at com.greatmancode.craftconomy3.storage.StorageHandler.<init>(StorageHandler.java:40) 13.02 02:02:26 [Server] WARN at com.greatmancode.craftconomy3.Common.initialiseDatabase(Common.java:397) 13.02 02:02:26 [Server] WARN at com.greatmancode.craftconomy3.Common.onEnable(Common.java:144) 13.02 02:02:26 [Server] WARN at com.greatmancode.craftconomy3.tools.interfaces.BukkitLoader.onEnable(BukkitLoader.java:49) 13.02 02:02:26 [Server] WARN at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) 13.02 02:02:26 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) 13.02 02:02:26 [Server] WARN at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) 13.02 02:02:26 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) 13.02 02:02:26 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) 13.02 02:02:26 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) 13.02 02:02:26 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) 13.02 02:02:26 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) 13.02 02:02:26 [Server] WARN at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) 13.02 02:02:26 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) 13.02 02:02:26 [Server] WARN at java.lang.Thread.run(Thread.java:748)

commented

Maybe try dropping and creating the database again.