Loading

mysql报错could not be resolved Name or service not known

问题: MySQL日志报错[Warning] IP address '192.168.1.12' could not be resolved: Name or service not known

 

 

原因:
mysql默认会反向解析DNS,对于访问者Mysql不会判断是hosts还是ip都会进行dns反向解析,频繁地查询数据库和权限检查,这大大增加了数据库的压力,导致数据库连接缓慢,严重的时候甚至死机,出现“连接数据库时出错”等字样

 

 

解决:
 
vim /etc/mycnf
[mysqld]
skip-name-resolve

 

posted @ 2021-07-23 14:35  bathing  阅读(825)  评论(0编辑  收藏  举报
Live2D