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

如果网上各种文档告诉你去配置/etc/my.cnf,你没找到的话,不防试试我这个,文件的位置在:

去里面找找看

注释掉bind-address

然后重置下密码:

use mysql

update user set authentication_string=password('wxhcj1314520'),plugin='mysql_native_password' where user='root';

然后刷新一下:

flush privileges;

原文地址:https://www.cnblogs.com/SATinnovation/p/9916332.html