【发布时间】:2021-08-08 20:47:05
【问题描述】:
我在将 Java Spring Boot 应用程序连接到 MySQL 数据库时遇到问题,请参阅标题等:java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
我已经在 3 台设备上安装了应用程序,1 台 Linux,2 台 Windows,从来没有遇到过这样的问题。
Java 应用程序在 Debian 10 机器上运行,MySQL 服务器也在那里运行。 Spring数据源地址:jdbc:mysql://localhost:3306/final?useSSL=false&?useUnicode=yes&characterEncoding=UTF-8
在网络统计中:
tcp6 0 0 :::33060 :::* LISTEN 32528/mysqld
tcp6 0 0 :::3306 :::* LISTEN 32528/mysqld
我也可以通过 telnet 连接到它。 在 MySQL 中,数据库用户拥有所有权限,所有用户主机设置为 %。 我试过在 MySQL 配置中设置 bind_address,设置用户,没有任何帮助。 试过 ufw allow mysqld, ufw disable too.
我能做什么?
【问题讨论】:
标签: java mysql linux networking jdbc