Mysql Lost connection to MySQL server at ‘reading initial communication packet', system error: 0

时间:2021-09-13 17:19:26

在用Navicat for MySQL远程连接mysql的时候,出现了

Lost connection to MySQL server at ‘reading initial communication packet', system error: 0

修改my.cnf文件(windows为my.ini)

一般在mysql的安装目录,/etc/mycnf。

在my.cnf配置文件中的[mysqld]区域添加skip-name-resolve,看网友说的是跳过mysql连接的DNS反向解析功能,这样能很好地提高mysql性能。在这种情况下,就只能使用MySQL授权表中的IP来连接mysql服务了。

参考:https://www.cnblogs.com/leeke98/p/9018045.html