Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of Warning when mysql enables skip-name-resolve mode

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to solve Warning when mysql enables skip-name-resolve mode". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Check the mysql alarm log and find two warnings, such as the following in red

[root@S243] # tail-f / mysql/datadir/S243.err

2017-02-15 08:59:57 23433 [Warning] 'user' entry' root@s243' ignored in-- skip-name-resolve mode.

2017-02-15 08:59:57 23433 [Warning] 'proxies_priv' entry' @ root@s243' ignored in-skip-name-resolve mode.

2017-02-15 09:00:00 23433 [Warning] 'user' entry' root@s243' ignored in-- skip-name-resolve mode.

2017-02-15 09:00:00 23433 [Warning] 'proxies_priv' entry' @ root@s243' ignored in-skip-name-resolve mode.

2017-02-15 09:22:58 23433 [Warning] 'user' entry' root@s243' ignored in-- skip-name-resolve mode.

2017-02-15 09:22:58 23433 [Warning] 'proxies_priv' entry' @ root@s243' ignored in-skip-name-resolve mode.

2017-02-15 09:23:03 23433 [Warning] 'user' entry' root@s243' ignored in-- skip-name-resolve mode.

2017-02-15 09:23:03 23433 [Warning] 'proxies_priv' entry' @ root@s243' ignored in-skip-name-resolve mode.

An article was found on the Internet. Verify that the problem has been solved, so stick it over and make a note.

Http://www.justwinit.cn/post/7539/

[practice OK] how to deal with Warning when mysql enables skip-name-resolve mode

Background: the purpose of the skip-name-resolve parameter is not to perform anti-parsing (ip is not converted to a domain name), which can speed up the response time of the database. Modify the configuration file to add and need to restart: after adding [mysqld] skip-name-resolve, it is found that there is a warning message in the error log:

[root@jackxiang mysql] # vi my.cnf

Skip-name-resolve

# prohibit MySQL from parsing DNS for external connections. Use this option to eliminate the time for MySQL to parse DNS. But it is important to note that if this option is turned on

# then all remote host connection authorizations must use IP addresses, otherwise MySQL will not be able to process connection requests properly

The practice is as follows:

Restart mysql and find that the log includes:

1) follow the prompts to query, sure enough, there is an empty account and the Host of the root account is jackxiang:

Select * from user where Host= "jackxiang"\ G

Mysql > select Host,User,Password from user where Host= "jackxiang"

+-- +

| | Host | User | Password | |

+-- +

| | jackxiang |

| | jackxiang | root | * 2CD42BDFDF0EB0E*Z****3458EB72EE1F17F26F |

+-- +

2) check the localhost, because most of them are limited to local connections and do not allow external machines to be connected to ensure security:

Mysql > select Host,User,Password from user where Host= "localhost" limit 2

+-- +

| | Host | User | Password | |

+-- +

| | localhost |

| | localhost | jack_mysql | * 2CD42BDFDF0E***3458EB72EE1F17F26F |

+-- +

3) modify the Host for which Host is jackxiang, user is empty or root to localhost:

Mysql > update user set Host= "localhost" where Host= "jackxiang"

ERROR 1062 (23000): Duplicate entry 'localhost-' for key' PRIMARY'

It won't work this way. We have to kill one by one. See if there is anyone with the same name as root. Check it out:

Mysql > select Host,User,Password from user where User= ""

+-+

| | Host | User | Password | |

+-+

| | localhost |

| | jackxiang |

+-+

Mysql > delete from user where User= "" and Password= ""

Query OK, 2 rows affected (0.01sec)

4) check that the user is root

Mysql > select Host,User,Password from user where User= "root"

+-- +

| | Host | User | Password | |

+-- +

| | localhost | root | * 2CD42BDFDF0EB0E1A7777777777EE1F17F26F |

| | jackxiang | root | * 2CD42BDFDF0EB0E1A7777777777EE1F17F26F |

| | 127.0.0.1 | root | * 2CD42BDFDF0EB0E1A7777777777EE1F17F26F |

| |:: 1 | root | * 2CD42BDFDF0EB0E1A7777777777EE1F17F26F |

+-- +

5) it is enough to leave localhost, and delete the rest:

Mysql > delete from user where Host! = "localhost" and User= "root"

Query OK, 3 rows affected (0.00 sec)

6) restart mysql:

There is another log warning:

[Warning] 'proxies_priv' entry' @ root@jackxiang' ignored in-- skip-name-resolve mode.

Solution:

Then delete the rows in the table mysql.proxies_priv that are similar to cvs related to a specific domain name, using the same method as above.

Mysql > select Host,User,Proxied_host,Proxied_user,With_grant,Grantor,Timestamp from proxies_priv

+-+

| | Host | User | Proxied_host | Proxied_user | With_grant | Grantor | Timestamp | |

+-+

| | localhost | root | 1 | | 2014-07-14 13:26:08 |

| | jackxiang | root | 1 | | 2014-07-14 13:26:08 |

+-+

Mysql > delete from proxies_priv where Host= "jackxiang"

Query OK, 1 row affected (0.02 sec)

Now it's completely quiet.

It turns out that it was caused by multiple grant authorizations after installing mysql at that time.

Note:

Skip-name-resolve is to disable dns parsing to avoid the error of accessing MYSQL caused by the network DNS parsing service, which should generally be enabled. When enabled, hostnames cannot be used in the authorization table of mysql, only IP can be used. This warning occurs because root@jackxiang account information already exists in the mysql table. Let's just delete it. Mysql > use mysql; mysql > delete from user where HOST='localhost.localdomain'; Query OK, 2 rows affected (0.00 sec) restart MYSQL and find that the warning is gone.

This is the end of the content of "how to solve Warning when mysql enables skip-name-resolve mode". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report