Home  >  Article  >  Database  >  mysql启用skip-name-resolve模式时出现Warning的处理办法

mysql启用skip-name-resolve模式时出现Warning的处理办法

WBOY
WBOYOriginal
2016-06-07 18:07:30908browse

在优化MYSQL配置时,加入 skip-name-resolve ,在重新启动MYSQL时检查启动日志,发现有警告信息

120726 11:57:22 [Warning] 'user' entry 'root@localhost.localdomain' ignored in --skip-name-resolve mode. www.2cto.com

120726 11:57:22 [Warning] 'user' entry '@localhost.localdomain' ignored in --skip-name-resolve mode.

skip-name-resolve是禁用dns解析,避免网络DNS解析服务引发访问MYSQL的错误,一般应当启用。

启用后,在mysql的授权表中就不能使用主机名了,只能使用IP ,出现此警告是由于mysql 表中已经存在有 localhost.localdomain 帐号信息。 www.2cto.com

我们把它删除就好了。
代码如下:
mysql>use mysql;
mysql> delete from user where HOST='localhost.localdomain';
Query OK, 2 rows affected (0.00 sec)

重启MYSQL ,发现警告已经没有啦。

作者 Naola2001
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn