error connecting to mysql database
cadafinnX opened this issue ยท 3 comments
Description
When I use MySQL I get an error indicating that the table already exists, but how come the table already exists if the database is new and another problem is that tables such as luckperms.luckperms_groups could not be created automatically, which I do not understand why the table could not be created.
Reproduction Steps
configure mysql database data
start the server
wait for luckperms to create all tables
Expected Behaviour
I was hoping luckperms would create the tables correctly because it managed to create two and they are messenger and user permission. I hope luckperms can create missing tables without any problem.
Server Details
Paper-132 (MC: 1,21,1)
LuckPerms Version
5.4.131
Logs and Configs
[20:09:01 INFO]: [LuckPerms] Enabling LuckPerms v5.4.131
[20:09:01 INFO]: __
[20:09:01 INFO]: | |) LuckPerms v5.4.131
[20:09:01 INFO]: |_ | Running on Bukkit - Paper
[20:09:01 INFO]:
[20:09:01 INFO]: [LuckPerms] Loading configuration...
[20:09:02 INFO]: [LuckPerms] Loading storage provider... [MYSQL]
[20:09:02 INFO]: [me.lucko.luckperms.lib.hikari.HikariDataSource] luckperms-hikari - Starting...
[20:09:02 INFO]: [me.lucko.luckperms.lib.hikari.HikariDataSource] luckperms-hikari - Start completed.
[20:09:02 ERROR]: [LuckPerms] Failed to init storage implementation
java.sql.BatchUpdateException: Table 'luckperms_group_permissions' already exists
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[?:?]
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.util.Util.handleNewInstance(Util.java:192) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.util.Util.getInstance(Util.java:167) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.util.Util.getInstance(Util.java:174) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.StatementImpl.executeBatchUsingMultiQueries(StatementImpl.java:1031) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.StatementImpl.executeBatchInternal(StatementImpl.java:839) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:794) ~[?:?]
at me.lucko.luckperms.lib.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:127) ~[?:?]
at me.lucko.luckperms.lib.hikari.pool.HikariProxyStatement.executeBatch(HikariProxyStatement.java) ~[?:?]
at me.lucko.luckperms.common.storage.implementation.sql.SqlStorage.applySchema(SqlStorage.java:197) ~[?:?]
at me.lucko.luckperms.common.storage.implementation.sql.SqlStorage.init(SqlStorage.java:170) ~[?:?]
at me.lucko.luckperms.common.storage.Storage.init(Storage.java:114) ~[?:?]
at me.lucko.luckperms.common.storage.StorageFactory.getInstance(StorageFactory.java:87) ~[?:?]
at me.lucko.luckperms.common.plugin.AbstractLuckPermsPlugin.enable(AbstractLuckPermsPlugin.java:201) ~[?:?]
at me.lucko.luckperms.bukkit.LPBukkitBootstrap.onEnable(LPBukkitBootstrap.java:175) ~[?:?]
at LuckPerms-Bukkit-5.4.131.jar/me.lucko.luckperms.bukkit.loader.BukkitLoaderPlugin.onEnable(BukkitLoaderPlugin.java:50) ~[LuckPerms-Bukkit-5.4.131.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.1.jar:1.21.1-132-b48403b]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.1.jar:1.21.1-132-b48403b]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:641) ~[paper-1.21.1.jar:1.21.1-132-b48403b]
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:590) ~[paper-1.21.1.jar:1.21.1-132-b48403b]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:293) ~[paper-1.21.1.jar:1.21.1-132-b48403b]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1214) ~[paper-1.21.1.jar:1.21.1-132-b48403b]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:329) ~[paper-1.21.1.jar:1.21.1-132-b48403b]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.sql.SQLSyntaxErrorException: Table 'luckperms_group_permissions' already exists
at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:762) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:779) ~[?:?]
at me.lucko.luckperms.lib.mysql.cj.jdbc.StatementImpl.executeBatchUsingMultiQueries(StatementImpl.java:1017) ~[?:?]
... 21 more
[20:09:02 INFO]: [LuckPerms] Loading messaging service... [SQL]
[20:09:03 INFO]: [LuckPerms] Loading internal permission managers...
[20:09:03 INFO]: [LuckPerms] Performing initial data load...
[20:09:03 WARN]: java.util.concurrent.CompletionException: java.sql.SQLSyntaxErrorException: Table 'luckperms.luckperms_groups' doesn't exist
[20:09:03 WARN]: at me.lucko.luckperms.common.storage.Storage.lambda$future$1(Storage.java:103)
[20:09:03 WARN]: at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
[20:09:03 WARN]: at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
[20:09:03 WARN]: at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
[20:09:03 WARN]: at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
[20:09:03 WARN]: at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
[20:09:03 WARN]: at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
[20:09:03 WARN]: at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
[20:09:03 WARN]: Caused by: java.sql.SQLSyntaxErrorException: Table 'luckperms.luckperms_groups' doesn't exist
[20:09:03 WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
[20:09:03 WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
[20:09:03 WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
[20:09:03 WARN]: at me.lucko.luckperms.lib.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003)
[20:09:03 WARN]: at me.lucko.luckperms.lib.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
[20:09:03 WARN]: at me.lucko.luckperms.lib.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
[20:09:03 WARN]: at me.lucko.luckperms.common.storage.implementation.sql.SqlStorage.selectGroups(SqlStorage.java:992)
[20:09:03 WARN]: at me.lucko.luckperms.common.storage.implementation.sql.SqlStorage.loadAllGroups(SqlStorage.java:497)
[20:09:03 WARN]: at me.lucko.luckperms.common.storage.Storage.lambda$loadAllGroups$11(Storage.java:202)
[20:09:03 WARN]: at me.lucko.luckperms.common.storage.Storage.lambda$future$1(Storage.java:98)
[20:09:03 WARN]: ... 7 more
[20:09:03 INFO]: [LuckPerms] Successfully enabled. (took 2363ms)
Extra Details
When creating the database, luckperms fails to create the tables automatically, causing errors saying that the table already exists or that the table is empty.
Does it work when you purge the data & restart?
Purging with Luckperms: /lp bulkupdate all delete
Also update you Luckperms Plugin pls