Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 mysql远程连接问题

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

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

好恶心,服务器重启了一次,就一上午都是在处理mysql的各种问题。

第一步:找到:my.cnf文件

其实我也不知道在哪里,用指令帮我们找吧。

find / -name my.cnf

找到了后。

第二步:vi my.cnf

vi my.cnf

在mysqld下添加skip-name-resolve

保存。

问题解决,可以连上了。

原文地址:https://www.cnblogs.com/invban/p/5824891.html