Skip to content
Advertisement

MySQL (Minecraft Java) Connection refused

i tried to access my MySQL Database with my Minecraft Server (Java) – Paper 1.16.5. But there’s this problem:

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
        at jdk.internal.reflect.GeneratedConstructorAccessor229.newInstance(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[patched_1.16.5.jar:git-Paper-443]
        at jdk.internal.reflect.GeneratedConstructorAccessor226.newInstance(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323) ~[patched_1.16.5.jar:git-Paper-443]
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[?:?]
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[?:?]
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[?:?]
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[?:?]
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[?:?]
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[?:?]
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[?:?]
        at com.btk5h.skriptdb.skript.EffExecuteStatement.executeStatement(EffExecuteStatement.java:216) ~[?:?]
        at com.btk5h.skriptdb.skript.EffExecuteStatement.lambda$execute$1(EffExecuteStatement.java:95) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.net.ConnectException: Verbindungsaufbau abgelehnt (Connection refused)
        at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[?:?]
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[?:?]
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[?:?]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:?]
        at java.net.Socket.connect(Socket.java:609) ~[?:?]
        at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211) ~[patched_1.16.5.jar:git-Paper-443]
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:299) ~[patched_1.16.5.jar:git-Paper-443]
        ... 24 more

I’m using Debian 10 on a KVM Root Server. This is the my.cnf file:

[client-server]
socket = /run/mysqld/mysqld.sock
bind-address    = 0.0.0.0
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

This is the mysql.cnf:

[mysql]
bind-address = 0.0.0.0

What’s the problem?

Advertisement

Answer

I fixed it by typing localhost, but my domain instead of localhost isn’t working

Advertisement