Solution and Analysis of slow MySQL Remote Access

Source: Internet
Author: User

Solution and Analysis of slow MySQL Remote Access
Environment Introduction:
OS: RHEL5.4
MySQL: 5.5.10
Exception scenarios:
The database has been accessed and used in the Intranet of the data center. A foreign node needs to access the database one day. After the access permission is activated, their feedback is very slow;
On the firewall, activate your company's IP address for access!
Start troubleshooting:
1. Check whether the network is stable? The answer is: The ping ttl value is stable, and ssh is also normal;
2. Check the MySQL running status without exception detection;
3. I suddenly remembered that MySQL's DNS-based resolution parameters may not be set during planning !!!
Solution:
1. Verify Parameters
Mysql> show variables like 'skip _ % ';
+ ----------------------- + ------- +
| Variable_name | Value |
+ ----------------------- + ------- +
| Skip_external_locking | ON |
| Skip_name_resolve | OFF |
| Skip_networking | OFF |
| Skip_show_database | OFF |
+ ----------------------- + ------- +
4 rows in set (0.00 sec)
Mysql> show variables like 'skip _ % ';
2. Stop the database and modify the parameters in my. cnf.
[Mysqld]
Skip_name_resolve
3. Verify after restarting the database:
Mysql> show variables like 'skip _ % ';
+ ----------------------- + ------- +
| Variable_name | Value |
+ ----------------------- + ------- +
| Skip_external_locking | ON |
| Skip_name_resolve | ON |
| Skip_networking | OFF |
| Skip_show_database | OFF |
+ ----------------------- + ------- +
4 rows in set (0.03 sec)
This option is used to disable DNS resolution, and the connection speed is much faster. However, you cannot use the host name in the MySQL authorization table but only the IP address.

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.