Home > Database > Mysql Tutorial > body text

MySQL DNS反解析过慢问题的解决办法

WBOY
Release: 2016-06-07 16:51:51
Original
1585 people have browsed it

最近发现新专栏的数据库连接非常慢,登陆MySQL数据库mysqlgt;show processlist;| 20681949 | unauthenticated user | 10.10.4.1

最近发现新专栏的数据库连接非常慢,登陆MySQL数据库

mysql>show processlist;

| 20681949 | unauthenticated user | 10.10.4.193:52497 | NULL | Connect | | Reading from net | NULL |

| 20681948 | unauthenticated user | 10.10.4.193:52495 | NULL | Connect | | Reading from net | NULL

发现有非常多的 unauthenticated user 尝试做登入使用 mysql 的情況 ,当这种情况无限制发生时就会造成系统十分缓慢。

查阅mysql官方网站得知,这属于官方一个系统上的特殊设定,就把他当成mysql的一个bug算了。不管链接的的方式是经过 hosts 或是 IP 的模式,他都会对 DNS 做反查 mysqld 会尝试去反查 IP -> dns ,由于反查解析过慢,,就会无法应付过量的查询。

解决办法:

/usr/local/mysql/bin/mysqld_safe --skip-name-resolve --user=mysql&

加 --skip-name-resolve 这么一个参数就可以,关闭mysql的dns反查功能。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!