Closed HugoSilvaF closed 2 years ago
when i reload the minecraft server the HikariPool create a new pool connection. However when it arrives at the 20th connection, i get an error. This error: "Too many connections"
My code of start and disable mysql:
private void disableMySQL() { try { if (mysql != null) { mysql.closeConnection(); } } catch (SQLException var2) { var2.printStackTrace(); } } private void startMySQL() { if (this.getConfig().getBoolean("mysql.enable")) { String url = "jdbc:mysql://" + this.getConfig().getString("mysql.host") + ":" + this.getConfig().getString("mysql.port") + "/" + this.getConfig().getString("mysql.database") + "/" + this.getConfig().getString("mysql.username") + "/" + this.getConfig().getString("mysql.password"); mysql = new MySQL("jdbc:mysql://" + this.getConfig().getString("mysql.host") + ":" + this.getConfig().getString("mysql.port") + "/" + this.getConfig().getString("mysql.database"), this.getConfig().getString("mysql.username"), this.getConfig().getString("mysql.password")); } }
This is not an issue with the library. You need to manage the lifecycle of the connection using the methods available on the server.
when i reload the minecraft server the HikariPool create a new pool connection. However when it arrives at the 20th connection, i get an error. This error: "Too many connections"![image](https://user-images.githubusercontent.com/8800040/169220183-719458a5-759a-4292-80a3-58ca67f2da30.png)
My code of start and disable mysql: