When the MySQL client connects to the MySQL server (the process is: mysqld), Mysqld creates a new thread to process the request. The thread first checks whether the host name is in the hostname cache. If not, the thread attempts to resolve the host name.
If the system is thread safe, gethostbyaddr_r () and Gethostbyname_r () are invoked to perform host name resolution;
If the system does not support thread-safe calls, the thread locks a mutex and invokes gethostbyaddr () and gethostbyname (). In this case, before the 1th line threads unlocked the mutex, no other thread can resolve the host name that is not in the host name cache.
Start mysqld with the--skip-name-resolve option to disable DNS host name lookup. At this point, you can only use the IP address in the MySQL authorization table, and you cannot use the host name.
If DNS resolution is slow and includes many hosts, improve performance by disabling DNS lookups with--skip-name-resolve or by adding host_cache_size definitions (default: 128) and recompiling mysqld;
Start the server with the--skip-host-cache option to disable host name caching. To clear the host name cache, execute the FLUSH hosts statement or execute the mysqladmin flush-hosts command.
If you want to completely disable TCP/IP connections, start the mysqld with the--skip-networking option.
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.