Wishlist 0 ¥0.00

mysql客户端连接很慢的解决办法

一般我们连接mysql,要么是通过终端直接连接,要么是使用navicat 这种软件连接,有时候会发生连接很慢的情况,大致分三种

1.远程连接mysql很慢,每次连接需要3秒及以上

原因是:

当远程访问mysql时, mysql会解析域名, 所以会导致访问速度很慢, 会有2,3秒延时!

解决办法:

修改mysql安装目录下的my.cnf,加上下面这个配置可解决此问题。在[mysqld]下加入:skip-name-resolve

保存退出后重启mysql服务。

然后访问速度就和本地一样快啦。

 

2.发现链接数据库出现 -A 这样的字样

原因是:就是因为数据表太多,需要预读数据表

解决办法:在[mysql]下加入:no-auto-rehash

 

3.navicat过一会再使用刚刚打开的那个页签,就会有个链接的过程,很慢

只要在 “编辑链接”->“高级”->“保持连接间隔设置为30秒” 就可以了

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.