【环境介绍】
系统环境:Red Hat Enterprise Linux 7 + 5.7.25-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)
【情况描述】
在安装完数据库之后,查看日志出现多个Warning信息:
2019-04-26T17:28:33.605994+08:00 0 [Note] Server socket created on IP: ‘::‘.
2019-04-26T17:28:33.652894+08:00 0 [Warning] ‘user‘ entry ‘[email protected]‘ ignored in --skip-name-resolve mode.
2019-04-26T17:28:33.653069+08:00 0 [Warning] ‘user‘ entry ‘[email protected]‘ ignored in --skip-name-resolve mode.
2019-04-26T17:28:33.653099+08:00 0 [Warning] ‘user‘ entry ‘[email protected]‘ ignored in --skip-name-resolve mode.
2019-04-26T17:28:33.653630+08:00 0 [Warning] ‘db‘ entry ‘performance_schema [email protected]‘ ignored in --skip-name-resolve mode.
2019-04-26T17:28:33.653648+08:00 0 [Warning] ‘db‘ entry ‘sys [email protected]‘ ignored in --skip-name-resolve mode.
2019-04-26T17:28:33.654222+08:00 0 [Warning] ‘proxies_priv‘ entry ‘@ [email protected]‘ ignored in --skip-name-resolve mode.
2019-04-26T17:28:33.707215+08:00 0 [Warning] ‘tables_priv‘ entry ‘user [email protected]‘ ignored in --skip-name-resolve mode.
2019-04-26T17:28:33.707301+08:00 0 [Warning] ‘tables_priv‘ entry ‘sys_config [email protected]‘ ignored in --skip-name-resolve mode.
【情况分析】
skip_name_resolve参数说明:
此变量是根据--skip-name-resolve选项的值设置的。 如果是OFF,mysqld检查客户端连接时解析主机名。 如果它是ON,mysqld只使用IP号码;
在这种情况下,授权表中的所有主机列值必须是IP地址或localhost。数据库验证主机来源,服务器要执行DNS的正向和反向查找,如果DNS出问题,会堆积起来,最终导致连接超时,建议设置该参数。
查看--skip-name-resolve参数信息:
[email protected](none) 08:45:14>show variables like ‘skip_name_resolve‘;
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| skip_name_resolve | ON |
+-------------------+-------+
1 row in set (0.01 sec)
[email protected](none) 08:45:38>system cat /etc/my.cnf|grep skip_name_resolve
skip_name_resolve = on
[email protected](none) 08:45:50>
查看用户信息:
[email protected](none) 08:34:30>select distinct User,Host from mysql.user;
+---------------+-----------+
| User | Host |
+---------------+-----------+
| tuan | % |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
4 rows in set (0.12 sec)
[email protected](none) 08:43:17>
官方参数信息:
该数据库是新搭建的,没有其他操纵,且初始化时并没有报错,在MOS上面查询,查看跟相似BUG 23329861 - WARNING ABOUT LOCALHOST WHEN USING SKIP-NAME-RESOLVE
查看该BUG信息,该BUG将在5.7.26进行修复:
描述信息跟BUG一致:
查看官方5.7.26文档对此BUG的描述:
【对数据库进行升级修复】
升级过程忽略,查看错误日志信息,已经修复waring:
mysql 设置skip_name_resolve参数 日志 [Warning] 'user' entry '[email protected]' ignored in --skip-name-resolve mode
原文地址:https://www.cnblogs.com/zetanchen/p/10784102.html