问题现象

MySQL 远程连接报错:Lost connection to MySQL server at 'reading initial communication packet'

解决方案

1、检查是否有防火墙限制
2、检查 MySQL 是否有访问权限

use mysql;
Grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;    
flush privileges;  

3、检查 my.ini 文件里是否设置了 bind-address 参数,如果有将该条注释掉即可。

4、在 my.ini 中添加 skip-name-resolve

vi /etc/my.cnf
[mysqld] 
skip-name-resolve  #增加这个

5、修改 hosts.allow

vi /etc/hosts.allow
mysqld-max : ALL :ALLOW   #增加这个

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-07-28
猜你喜欢
  • 2021-07-05
  • 2022-12-23
  • 2021-07-26
  • 2021-12-30
  • 2022-12-23
  • 2021-08-10
  • 2021-10-06
相关资源
相似解决方案