--skip-name-resolve
Do not resolve host names when checking client connections. Use only IP addresses. If you use this option, all Host column values in the grant tables must be IP addresses or localhost. See Section 7.9.8, “How MySQL Uses DNS”.
--skip-networking
Do not listen for TCP/IP connections at all. All interaction with mysqld must be made using named pipes or shared memory (on Windows) or Unix socket files (on Unix). This option is highly recommended for systems where only local clients are permitted. See Section 7.9.8, “How MySQL Uses DNS”.
如果反解析很慢,则会造成很多请求unauthenticated user 在login状态
配置文件中加入
--skip-name-resolve
When a new client connects to mysqld
, mysqld
spawns a new thread to handle the
request. This thread first checks whether the host name is in the host name
cache. If not, the thread attempts to resolve the host name:
-
The thread takes the IP address and resolves it to a host name (using gethostbyaddr()
). It then takes that host name and
resolves it back to the IP address (using gethostbyname()
) and compares to ensure it is the original
IP address.
-
If the operating system supports the thread-safe gethostbyaddr_r()
and gethostbyname_r()
calls, the thread uses them to perform
host name resolution.
-
If the operating system does not support the thread-safe calls, the thread
locks a mutex and calls gethostbyaddr()
and gethostbyname()
instead. In this case, no other thread can
resolve host names that are not in the host name cache until the first thread
unlocks the mutex.
You can disable DNS host name lookups by starting mysqld
with the --skip-name-resolve
option. However, in this case, you
can use only IP addresses in the MySQL grant tables.
If you have a very slow DNS and many hosts, you can get more performance by
either disabling DNS lookups with --skip-name-resolve
or by increasing the HOST_CACHE_SIZE
define (default value: 128) and recompiling
mysqld
.
You can disable the host name cache by starting the server with the --skip-host-cache
option. To clear the host name cache,
issue a FLUSH HOSTS
statement or execute the mysqladmin
flush-hosts
command.
To disallow TCP/IP connections entirely, start mysqld
with the --skip-networking
option.
分享到:
相关推荐
在优化MYSQL配置时,加入 skip-name-resolve ,在重新启动MYSQL时检查启动日志,发现有警告信息
最近在Linux服务器上安装MySql5后,本地使用客户端连MySql...附: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
主要介绍了mysql 加了 skip-name-resolve不能链接数据库问题的解决方法,需要的朋友可以参考下
skip-name-resolve skip-grant-tables 官方的解释 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 ...
发现大量的进程的状态为 login 原来默认的时候mysql启动时是不使用 skip-name-resolve选项的,这样的话,从其它主机的连接会比较慢,因为mysql会对这个ip做dns反向查询,导致大量的连接处于 login状态….....
赠送jar包:netty-resolver-dns-4.1.65.Final.jar; 赠送原API文档:netty-resolver-dns-4.1.65.Final-javadoc.jar; 赠送源代码:netty-resolver-dns-4.1.65.Final-sources.jar; 赠送Maven依赖信息文件:netty-...
mysql-connector-java-5.1.47用jdbc语言连接数据库的一种工具包
java连接mysql的稳定驱动
赠送jar包:netty-codec-dns-4.1.65.Final.jar; 赠送原API文档:netty-codec-dns-4.1.65.Final-javadoc.jar; 赠送源代码:netty-codec-dns-4.1.65.Final-sources.jar; 赠送Maven依赖信息文件:netty-codec-dns-...
赠送jar包:netty-resolver-dns-4.1.74.Final.jar; 赠送原API文档:netty-resolver-dns-4.1.74.Final-javadoc.jar; 赠送源代码:netty-resolver-dns-4.1.74.Final-sources.jar; 赠送Maven依赖信息文件:netty-...
axios-cached-dns-resolve Axios使用node.js dns.lookup解析主机名。 dns.lookup是同步的,并且在有限的libuv线程池上执行。 每个axios请求都将解析kubernetes,openshift和云环境中的dns名称,这些dns名称是故意将...
1、qiniu-java-sdk:7.2版本所有版本jar包和6.1.71、6.1.9两个版本jar包。 2、happy-dns-java:0.1.1至0.1.6各版本jar包。
可以在配置文件里面禁止MySQL进行反向DNS解析,只需在my.cnf的[mysqld]段落中加入如下行即可: skip-name-resolve (windows与linux下一样的) 设备在连接mysql时候,等待服务器的banner信息需要4s左右,影响了Mysql...