How to add mysql skip name resolve
Asked Answered
S

3

13

I have to connect to my MYSQL server via remote connection from my pc, The connection works. But its too slow.

From my reasearch I heard adding a line,

skip name resolve

is going to speed it up. But where to add this? And how?

I am using mysql 5.7 with Ubuntu 16.04. Is there any tutorial or something for this? I am noob. Can anyone please help me?

Seleucia answered 14/2, 2017 at 5:11 Comment(0)
A
11
  1. Add option skip-name-resolve in your config file.
  2. Add cmd line option --skip-name-resolve when you start mysqld or mysqld_safe.
Ataman answered 14/2, 2017 at 7:6 Comment(3)
But still the same. Is this what you meant? sudo service mysql start --skip-name-resolveSeleucia
if your os is ubuntu, you can start your mysql using the cmd line . Run mysqld or mysqld_safe with the option --skip-name-resolve. Just like bellow:Ataman
shell> /../../mysqld --defauts-file=.../your config --skip-name-resolveAtaman
J
29

Edit the below metioned file and add the given code.

/etc/mysql/my.cnf OR For Ubuntu16.* /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
skip-name-resolve

And restart MySQL server using below command.

sudo service mysql restart
Judie answered 14/2, 2017 at 8:45 Comment(4)
Config file was : /etc/mysql/mysql.conf.d/mysqld.cnf. But still the same.Seleucia
@Seleucia try this command to restart you mysql server sudo /etc/init.d/mysql start. Let me know what is actual error do you have now ?Judie
In Ubuntu 16 the file to edit is /etc/mysql/mysql.conf.d/mysqld.cnfAvesta
If I did add skip-name-resolve: 1. Should I use server IP address to connect remotely to the database? 2. Should I update my user host values in mysql.user table with IP addresses instead of host name?Wintry
A
11
  1. Add option skip-name-resolve in your config file.
  2. Add cmd line option --skip-name-resolve when you start mysqld or mysqld_safe.
Ataman answered 14/2, 2017 at 7:6 Comment(3)
But still the same. Is this what you meant? sudo service mysql start --skip-name-resolveSeleucia
if your os is ubuntu, you can start your mysql using the cmd line . Run mysqld or mysqld_safe with the option --skip-name-resolve. Just like bellow:Ataman
shell> /../../mysqld --defauts-file=.../your config --skip-name-resolveAtaman
L
0

Open Mariadb/MySQL config:

nano /etc/mysql/my.cnf

Add this line to your config:

skip-name-resolve=ON

Reload MySQL Server config:

systemctl reload mariadb
Lorola answered 24/8 at 22:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.