SQL error on first install #68


  • Defect
  • Started
Open
Assigned to _ForgeUser7265008
  • _ForgeUser10483760 created this issue Mar 21, 2014

    What steps will reproduce the problem?
    1. Fresh install of SQLInventory.
    2. Mysql > Create a new database, assign user, update InventorySQL config.yml
    3. Start server - SQL error in server log, plugin disabled.

    What is the expected output? What do you see instead?

    What version of the product are you using?
    InventorySQL 3.4.0
    Spigot version git-Spigot-1337
    mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

    Do you have an error log of what happened?
    [10:49:45 INFO]: [InvSQL] Enabling InventorySQL v3.4.0
    [10:49:45 INFO]: null
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'food
    -- -----------------------------------------------------

    -- ALTER TABLE `i' at line 1
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_51]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[?:1.7.0_51]
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.7.0_51]
            at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[?:1.7.0_51]
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.Util.getInstance(Util.java:382) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:779) ~[spigot.jar:git-Spigot-1337]
            at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:622) ~[spigot.jar:git-Spigot-1337]
            at tk.manf.InventorySQL.database.handler.MySQLDatabaseHandler.init(MySQLDatabaseHandler.java:71) ~[InventorySQL.3.4.5.jar:?]
            at tk.manf.InventorySQL.manager.DatabaseManager.reload(DatabaseManager.java:63) ~[InventorySQL.3.4.5.jar:?]
            at tk.manf.InventorySQL.manager.DependenciesManager.checkDatabaseHandler(DependenciesManager.java:79) [InventorySQL.3.4.5.jar:?]
            at tk.manf.InventorySQL.manager.DependenciesManager.initialise(DependenciesManager.java:54) [InventorySQL.3.4.5.jar:?]
            at tk.manf.InventorySQL.InventorySQLPlugin.onEnable(InventorySQLPlugin.java:59) [InventorySQL.3.4.5.jar:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:250) [spigot.jar:git-Spigot-1337]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:350) [spigot.jar:git-Spigot-1337]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:390) [spigot.jar:git-Spigot-1337]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugin(CraftServer.java:460) [spigot.jar:git-Spigot-1337]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.enablePlugins(CraftServer.java:380) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.m(MinecraftServer.java:348) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.g(MinecraftServer.java:325) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.a(MinecraftServer.java:281) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:186) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:437) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot.jar:git-Spigot-1337]
    [10:49:45 INFO]: [InvSQL][DEBUG] [Developer Message from manf] You did not specify proper a proper Handler. Please specify a correct Classname for the missing Handler
    [10:49:45 INFO]: [InvSQL] Disabling InventorySQL v3.4.0
    [10:49:45 ERROR]: Error occurred while disabling InventorySQL v3.4.0 (Is it up to date?)
    java.lang.NullPointerException
            at tk.manf.InventorySQL.InventorySQLPlugin.onDisable(InventorySQLPlugin.java:124) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:252) ~[spigot.jar:git-Spigot-1337]
            at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:374) [spigot.jar:git-Spigot-1337]
            at tk.manf.InventorySQL.InventorySQLPlugin.onEnable(InventorySQLPlugin.java:64) [InventorySQL.3.4.5.jar:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:250) [spigot.jar:git-Spigot-1337]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:350) [spigot.jar:git-Spigot-1337]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:390) [spigot.jar:git-Spigot-1337]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugin(CraftServer.java:460) [spigot.jar:git-Spigot-1337]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.enablePlugins(CraftServer.java:380) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.m(MinecraftServer.java:348) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.g(MinecraftServer.java:325) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.a(MinecraftServer.java:281) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:186) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:437) [spigot.jar:git-Spigot-1337]
            at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot.jar:git-Spigot-1337]

    Please provide any additional information below.

    [minecraft@centosvm InventorySQL]$ cat config.yml
    update-events:
      - quit
    serverID: 'crazypig'
    database:
      url: 'jdbc:mysql://localhost:3306/inventorysql?user=minecraft&password=XXXXX'
      handler: 'tk.manf.InventorySQL.database.handler.MySQLDatabaseHandler'
    data:
      serializer: 'tk.manf.InventorySQL.datahandling.serializer.SimpleSerializer'
      compressor: 'tk.manf.InventorySQL.datahandling.compressor.GZipCompressor'
    enable-metrics: true
    save-interval: 60
    auto-update: true

    [minecraft@centosvm InventorySQL]$ cat dbhandler.yml
    tables:
      prefix: ''
      suffix: ''
      player: 'player'
      inventory: 'inventory'

  • _ForgeUser10483760 added the tags New Defect Mar 21, 2014
  • _ForgeUser7265008 posted a comment Mar 21, 2014

    Open the Jar and search for the file CREATE.sql in the mysql folder. Delete all comments of the query and save the File. Restart your server then.

    if this does not help, post the error log in debug level 1000!

  • _ForgeUser10483760 posted a comment Mar 21, 2014

    Thanks for your prompt reply. Made the changes - the SQL error seems to have gone away. Have an error about the handler now (which was also present from the beginning, just didn't know it was a separate issue). FYI I've not made any edits about the handler as the config pages say "Does not need to be changed". Have I misunderstood, is there something I need to do here? Thanks.

    Error from log below :

    [13:55:41] [Server thread/INFO]: [InvSQL] Enabling InventorySQL v3.4.0 [13:55:42] [Server thread/INFO]: [InvSQL][DEBUG] [Developer Message from manf] You did not specify proper a proper Handler. Please specify a correct Classname for the missing Handler [13:55:42] [Server thread/INFO]: [InvSQL] Disabling InventorySQL v3.4.0 [13:55:42] [Server thread/ERROR]: Error occurred while disabling InventorySQL v3.4.0 (Is it up to date?) java.lang.NullPointerException at tk.manf.InventorySQL.InventorySQLPlugin.onDisable(InventorySQLPlugin.java:124) [?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:252) [spigot.jar:git-Spigot-1337] at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:374) [spigot.jar:git-Spigot-1337] at tk.manf.InventorySQL.InventorySQLPlugin.onEnable(InventorySQLPlugin.java:64) [InventorySQL.3.4.5.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:250) [spigot.jar:git-Spigot-1337] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:350) [spigot.jar:git-Spigot-1337] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:390) [spigot.jar:git-Spigot-1337] at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugin(CraftServer.java:460) [spigot.jar:git-Spigot-1337] at org.bukkit.craftbukkit.v1_7_R1.CraftServer.enablePlugins(CraftServer.java:380) [spigot.jar:git-Spigot-1337] at net.minecraft.server.v1_7_R1.MinecraftServer.m(MinecraftServer.java:348) [spigot.jar:git-Spigot-1337] at net.minecraft.server.v1_7_R1.MinecraftServer.g(MinecraftServer.java:325) [spigot.jar:git-Spigot-1337] at net.minecraft.server.v1_7_R1.MinecraftServer.a(MinecraftServer.java:281) [spigot.jar:git-Spigot-1337] at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:186) [spigot.jar:git-Spigot-1337] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:437) [spigot.jar:git-Spigot-1337] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot.jar:git-Spigot-1337]

  • _ForgeUser13074691 posted a comment Mar 21, 2014

    @TheLecturer: Go

    I too am having this issue.

    Also I may be a little confused. "Delete all the comments in the Query"

    Does that basically mean anything with a double dash in front of it? Cause that includes the food/health stuff at the very bottom. I'm using Notepad so it's all green, I removed all the green and it solved it, but now I also get this Handler error.

    But.... I don't know if in doing this, I removed the tables for health and hunger, and I really need that to also be stored. Thanks.


    Edited Mar 21, 2014
  • _ForgeUser7265008 posted a comment Mar 22, 2014

    @TheChiz: Go

    I fixed the second issue in snapshot 6. I forgot to publish some data.

  • _ForgeUser7265008 removed a tag New Apr 11, 2014
  • _ForgeUser7265008 added a tag Fixed Apr 11, 2014
  • _ForgeUser7265008 closed issue Apr 11, 2014
  • _ForgeUser7265008 removed a tag Fixed Apr 11, 2014
  • _ForgeUser7265008 added a tag Started Apr 11, 2014
  • _ForgeUser7265008 reopened issue Apr 11, 2014
  • _ForgeUser8971318 posted a comment Aug 9, 2014

    @TheChiz: Go

    That doesnt remove the tables, those tables dont exist. Those were just for old database conversion.

    also the comment above the alter table queries should read

    -- Add stats to Playerdatabase: max, min-HP, food
    

    to not cause an error.


    Edited Aug 9, 2014

To post a comment, please login or register a new account.