MySQL(Minecraft Java)连接被拒绝
MySQL (Minecraft Java) Connection refused
我尝试使用我的 Minecraft 服务器 (Java) 访问我的 MySQL 数据库 - 论文 1.16.5。但是有这个问题:
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(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
我在 KVM 根服务器上使用 Debian 10。
这是 my.cnf 文件:
[client-server]
socket = /run/mysqld/mysqld.sock
bind-address = 0.0.0.0
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
这是mysql.cnf:
[mysql]
bind-address = 0.0.0.0
有什么问题?
我通过输入 localhost 修复了它,但我的域而不是 localhost 不起作用
我尝试使用我的 Minecraft 服务器 (Java) 访问我的 MySQL 数据库 - 论文 1.16.5。但是有这个问题:
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(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
我在 KVM 根服务器上使用 Debian 10。 这是 my.cnf 文件:
[client-server]
socket = /run/mysqld/mysqld.sock
bind-address = 0.0.0.0
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
这是mysql.cnf:
[mysql]
bind-address = 0.0.0.0
有什么问题?
我通过输入 localhost 修复了它,但我的域而不是 localhost 不起作用