`

mysql连接com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications l

 
阅读更多
原文地址:http://blog.sina.com.cn/s/blog_49cc672f0100w5fb.html


tomcat程序连接服务器mysql数据库,报
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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.
错误,后来用java程序直接连接数据库,还是一样的错误,数据库连接,用户名密码都没有问题。
在网上查了很多情况,什么数据库用户权限设置,还是数据库连接等待时间(wait_timeout)设置,都没用。
而连接本地的数据库就没问题,本地数据库版本:5.0.37,服务器数据库版本:5.0.19,JDBC驱动版本:
mysql-connector-java-5.1.9-bin.jar。
这个问题困扰了一天,后来想想换换5.0的驱动看看怎么样,结果在网上找了个mysql-connector-java-5.1.14-bin.jar的驱动,结果OK了。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics