Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL skip-name-resolve

Tags:

mysql

mariadb

I use MariaDB / MySQL in 1 dedicated server. All databases & PHP are in local server. I don't use remote server.

When running mysqltuner, i received recommendation to use "skip-name-resolve".

So i added this code in my.cnf

skip-name-resolve

and i restarted mysql.

My questions are :

  1. Will using skip-name-resolve speed up my mysql ?

  2. When i check my mysql.db & mysql.user tables, i still see my server hostname (such as "host.myserver.com" / my public dedicated IP (not 127.0.0.1) in the "host" column. Should i change the value of "host" column too? Or i just need to leave everything as-is after adding skip-name-resolve?

like image 999
Crypto Newbie Avatar asked Aug 18 '16 06:08

Crypto Newbie


People also ask

How do I find my host cache?

Monitoring the Host Cache The Performance Schema host_cache table exposes the contents of the host cache. This table can be examined using SELECT statements, which may help you diagnose the causes of connection problems. The Performance Schema must be enabled or this table is empty.

What is DNS in MySQL?

MySQL supports the use of DNS SRV records for connecting to servers. A client that receives a DNS SRV lookup result attempts to connect to the MySQL server on each of the listed hosts in order of preference, based on the priority and weighting assigned to each host by the DNS administrator.


1 Answers

  1. If you are not connecting to your server from a remote host, then no, this is not going to speed up your mysql server. Slow DNS connection plus lots of remote hosts is the scenario when this option helps.

  2. If you turn off the name resolution, then entries with IP addresss only will be used by mysql when checking the access rights.

See mysql documentation on DNS Lookup Optimization and the Host Cache for further details.

like image 116
Shadow Avatar answered Sep 17 '22 18:09

Shadow