Error while performing database login with the com.mysqtest driver: Communications link failure. The last packet sent successfully to the server was 0 milliseconds ,the driver has not received any packets from the server.
解决方式如下
使用cmd调出dos终端,先自己连接一次数据库,看是否成功
C:\Users\Administrator>mysql -uroot -p test
Enter password: ******
ERROR 2003 (HY000): Can't connect to MySQL
C:\Users\Administrator>mysql -uroot -p
Enter password: ******
ERROR 2003 (HY000): Can't connect to MySQL
C:\Users\Administrator>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
C:\Users\Administrator>mysql -uroot -p
Enter password: ******