In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to solve the problem of MySql using skip-name-resolve to solve the problem of slow external network connection clients. I hope you will learn a lot after reading this article. Let's discuss it together.
Use the following to resolve
[mysqld] skip-name-resolveskip-grant-tables
An official explanation
How MySQL
Uses DNS When a new thread connects to mysqld, mysqld will
Spawn a new thread to handle the request. This thread will first check
If the hostname is in the hostname cache. If not the thread will call
Gethostbyaddr_r () and gethostbyname_r () to resolve the hostname. If
The operating system doesn't support the above thread-safe calls, the
Thread will lock a mutex and call gethostbyaddr () and gethostbyname ()
Instead. Note that in this case no other thread can resolve other
Hostnames that is not in the hostname cache until the first thread is
Ready. You can disable DNS host lookup by starting mysqld with
-skip-name-resolve. In this case you can however only use IP names in
The MySQL privilege tables. If you have a very slow DNS and many
Hosts, you can get more performance by either disabling DNS lookop
With-skip-name-resolve or by increasing the HOST_CACHE_SIZE define
(default: 128) and recompile mysqld. You can disable the hostname
Cache with-skip-host-cache. You can clear the hostname cache with
FLUSH HOSTS or mysqladmin flush-hosts. If you don't want to allow
Connections over TCP/IP, you can do this by starting mysqld with
-skip-networking.
According to the documentation, if your mysql host is slow to query DNS or there are many client hosts, it will lead to slow connection, because our development machine is unable to connect to the external network, so DNS parsing is impossible, so we can understand why the connection is so slow. At the same time, please note that after adding this configuration parameter, the host field in mysql's authorization table cannot use the domain name but can only use the ip address, because this is the result of disabling domain name resolution.
After reading this article, I believe you have a certain understanding of how to solve the problem that MySql uses skip-name-resolve to solve the problem of slow external network connection. If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.