今天数据库无缘无故连不上去给我报了
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
解决问题!