MySQL 如何添加mysql跳过名称解析

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42218326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 22:12:20  来源:igfitidea点击:

How to add mysql skip name resolve

mysqlubuntu

提问by humbleiam

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

我必须从我的电脑通过远程连接连接到我的 MYSQL 服务器,连接有效。但它太慢了。

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?

我在 Ubuntu 16.04 上使用 mysql 5.7。是否有任何教程或其他内容?我是菜鸟。谁能帮帮我吗?

采纳答案by songlei.wang

  1. Add option skip-name-resolvein your config file.
  2. Add cmd line option --skip-name-resolvewhen you start mysqldor mysqld_safe.
  1. skip-name-resolve在您的配置文件中添加选项。
  2. option --skip-name-resolve启动时添加 cmd 行mysqldmysqld_safe.

回答by TIGER

Edit the below metioned file and add the given code.

编辑下面提到的文件并添加给定的代码。

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

/etc/mysql/my.cnf或对于 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.

并使用以下命令重新启动 MySQL 服务器。

sudo service mysql restart