Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add mysql skip name resolve

Tags:

mysql

ubuntu

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?

like image 857
humbleiam Avatar asked Feb 14 '17 05:02

humbleiam


2 Answers

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
like image 73
TIGER Avatar answered Oct 20 '22 05:10

TIGER


  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.
like image 41
songlei.wang Avatar answered Oct 20 '22 05:10

songlei.wang