我正在尝试使用“新建连接向导”测试从 NetBeans IDE8.0 到 Cpanel MySql 数据库的连接。 我已经在 Cpanel 的 Remote MySql 选项中添加了我的机器 IP 地址,但仍然无法连接数据库。 我收到以下错误消息
Cannot establish a connection to jdbc:mysql:// someIP:3306/hariom?zeroDateTimeBehavior=convertToNull using com.mysql.jdbc.Driver (Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
最佳答案
如果您的服务器安装了 ConfigServerFirewall,即使您在 cPanel 上打开了远程 mysql,您也需要打开该端口。如果您不拥有服务器,则需要联系主机。
关于java - 如何从本地计算机连接 CPanel MySql DB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22909545/