The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

在这里插入图片描述
这个错误有可能是数据库没有打开造成的。

这个时候要打开任务管理器的服务选项卡查看mysql的服务是否有启动,如果未启动,则右键点击启动即可。如下图所示。
在这里插入图片描述