PHP remote connection to MYSQL database is very slow solution

Source: Internet
Author: User
Tags reverse dns
If a problem occurs twice, it is worth studying. The last time the customer said that the MYSQL database was slow, I was still thinking, isn't it a PHP problem? I don't know how to solve it. so I installed MYSQL on the server where his space is located to solve the problem. today I have another problem. I can't install a MYSQL on this server, search:

PHP remote connection to MYSQL is slow. sometimes it takes 4-20 seconds to remotely connect to MYSQL, and the local connection to MYSQL is normal. the main cause of this problem is that the reverse DNS resolution is enabled for MYSQL installed by default, in my. ini (in WINDOWS) or MY. add the skip-name-resolve statement to the [mysqld] of the CNF (UNIX or LINUX) file and save it.

Start -- run -- cmd -- net stop mysql -- net start mysql -- haha, success

Path of my. ini: D: \ Program Files \ MySQL Server 5.0 \ my. ini

It turned out to be a problem with MySQL. after this operation, the host name cannot be used in the MySQL authorization table, but only the ip address can be used.

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.