A server PHP connection database, the database address is used for external IP, to facilitate the occasional access to the database connection handle requires 2s

Source: Internet
Author: User
Tags mysql login
A server PHP connection database, the database address is used external IP, resulting in the occasional database connection handle requires 2s
This post was last edited by u011822059 on 2013-09-03 11:29:58

Title:

Server on the PHP connection server MySQL database, the database address is used external IP, resulting in occasional MySQL database connection handle need 2s,

This means that the database address of MySQL is connected to the IP of the extranet (e.g. 22.34.1.12),

Change to 127.0.0.1 will not be new, get the connection handle need 2s case,

This 2s is occasionally appearing, want to know the reason, specific point, thank you php?mysql? Connection handles? Extranet IP PHP 2s Connection Handle MySQL

Share to:


------Solution--------------------
If there is only one IP, the direct access
If there are 2 or more IPs, you need a routing
------Solution--------------------
server-> firewall->isp-> Firewall->mysql, and then a reverse, ISP this section of how many laps to be difficult to say
------Solution--------------------
reference:
2s is really within the acceptable range, MySQL has a set of parameters that do not resolve the domain name will be enabled to see this.

MySQL users are actually composed of host name and user name, so the MySQL login process determines the host name of the client,
This process requires the MySQL server to do the client's IP reverse Domain name resolution, determine the host name of the client.
You can modify the Skip-name-resolve parameter to set
  • 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.