MySQL反解析出现could not be resolved: Name or service not known解决办法

阿豪 20-03-31 2.11 K阅读

温馨提示:这篇文章已超过668天没有更新,请注意相关的内容是否还可用!

错误日志有类似警告

120119 16:26:04 [Warning] IP address '192.168.1.10' could not be resolved: Name or service not known

120119 16:26:04 [Warning] IP address '192.168.1.14' could not be resolved: Name or service not known

120119 16:26:04 [Warning] IP address '192.168.1.17' could not be resolved: Name or service not known

通过show processlist发现大量类似如下的连接:

|592|unauthenticated user|192.168.1.10:35320|NULL|Connect| |login|NULL|

|593|unauthenticated user|192.168.1.14:35321|NULL|Connect| |login|NULL|

|594|unauthenticated user|192.168.1.17:35322|NULL|Connect| |login|NULL|

解決办法

修改配置文件添加并需要重启:

[mysqld] 

skip-name-resolve

skip-name-resolve 参数的作用:不再进行反解析(ip不反解成域名),这样可以加快数据库的反应时间


文章版权声明:除非注明,否则均为阿豪运维笔记原创文章,转载或复制请以超链接形式并注明出处。

相关阅读

如何使用phpMyAdmin查看关键字在数据库哪个表中

Centos 8.3系统搭建LAMP(Linux+Apache+MySQL+PHP)环境

Ubuntu 16.04编译安装PHP 5.6.31 + Nginx 1.18.0 + MySQL 5.6.51

mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this opera

Centos7系统下yum安装LNMP环境

Windows安装PHP7.1+Apache2.4+Mysql5.5

初始化mysql数据库提示缺少dumper模块解决方法

Windows安装Mysql5.5