今天数据库无缘无故连不上去给我报了
Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0 这个错误,百度一下然后解决了这个问题:
先找到my.cnf:
whereis my.cnf
找到my.cnf后:
vi my.cnf
在mysqld配置项加多一行代码:
skip-name-resolve
然后重启mysql服务
service mysqld restart
解决问题!
本文详细介绍了如何解决MySQL数据库连接丢失的问题,通过在my.cnf文件中添加skip-name-resolve参数,并重启mysql服务,成功解决了Lost connection to MySQL server错误。
2845

被折叠的 条评论
为什么被折叠?



