Solution to the problem that mysql cannot connect to the database with skip-name-resolve, skipnameresolve

Source: Internet
Author: User

Solution to the problem that mysql cannot connect to the database with skip-name-resolve, skipnameresolve

Mysql cannot be linked with skip-name-resolve,

Check whether MySql has used host name authorization.

Add the following two lines to the MySql Server configuration file My. ini:

[Mysqld]
Skip-name-resolve

It will prohibit MySql Server from performing DNS resolution on external connections. Using this option can eliminate the time for MySql to perform DNS resolution.
However, if this option is enabled, IP addresses are required for all remote host connection authorizations. Otherwise, MySQL cannot process connection requests normally.
If the skip-name-resolve option is enabled, make sure that MySql has used host name authorization,

Run the following command in mysql:

Mysql> select user, host from mysql. user where host <> 'localhost ';

Generally, you will get a record with "%" authorization (that is, any address:

If no record exists, the condition is not met. You need to change the localhost to 127.0.0.1.

Mysql cannot be connected when skip-name-resolve is added. After modification, restart mysql.

If the host name is "DB1" "DB2", delete the hostanme record in the authorization table and restart mysqld.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.