重装系统后第一次装mysql, 中间没有任何问题. 项目一跑起来访问数据库时提示:
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.
然后上网一查, 结果说是与Mysql空闲等待时间有关, 也照着修改了my.ini
- [mysqld]
- wait_timeout=31536000
- interactive_timeout=31536000
也有人说可以换成c3p0的连接方式, 但项目里不能改动,
最后猜想只有可能是mysql本身的问题了, 于是卸载了重装一个5.1版本的。
把sql导入后, 项目启动,连接成功了,没有再报错