strifel / VBans

Ban your Velocity players!
https://forums.velocitypowered.com/t/vbans-ban-your-players/295
GNU General Public License v3.0
7 stars 6 forks source link

Could not create connection to database server. #13

Closed ComputersWithTimo closed 2 years ago

ComputersWithTimo commented 2 years ago

I just recently moved my velocity proxy from an CentOS 7 to a AlmaLinux 8 Server.

When trying to connect to the new database, I get this error: [11:34:18 ERROR]: An error occoured while connecting to MySQL: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

and on the mariadb: [Warning] Aborted connection 11 to db: 'minecraft' user: 'minecraft' host: 'localhost' (Got an error reading communication packets)

When trying it with another mariadb on a different server, I get the same error.

Only when connecting to the original database, it works.

Setup original server: OS: CentOS 7 MariaDB: 10.5.13 JDK: OpenJDK 17.0.1

New server: OS: AlmaLinux 8 MariaDB: 10.5.13 JDK: OpenJDK 17.0.3 LTS

DB server: OS: AlmaLinux 8 MariaDB 10.3.32

Config:

[Database] host="127.0.0.1" port=3306 database="minecraft" username="minecraft" password="removed" [Messages] StandardBanMessage="The ban hammer has spoken!" StandardKickMessage="Kicked by an operator!" BanLayout="§4§lBANNED:§r\n§aUntil: $bannedUntil§r\n§3Reason: §r§b$reason§r\n§cBanned by: $bannedBy§r" KickLayout="§4§lYou got kicked:\n §r$reason" BannedBroadcast="$bannedBy banned $player until $bannedUntil for $reason" [Options] changeToGCommands=true

When using shell mysql command it works fine mysql -h 127.0.0.1 -P 3306 -u minecraft -p minecraft

strifel commented 2 years ago

I have no real idea here, sorry.

What you can try is replacing the jdbc jar (located under plug-ins/vbans/jdbc.jar) with a newer version from https://www.oracle.com/de/database/technologies/appdev/jdbc-downloads.html

ComputersWithTimo commented 2 years ago

What you can try is replacing the jdbc jar (located under plug-ins/vbans/jdbc.jar) with a newer version from https://www.oracle.com/de/database/technologies/appdev/jdbc-downloads.html

Wrong link btw. The one you send is for an Oracle DB, not MySQL. For anyone reading up on this, this would be the correct driver: https://github.com/mysql/mysql-connector-j

I just swapped it with the driver i use for the Plan Plugin (MYSQL J 8.0.29) and now it works fine.