Why is connecting to MySQL server so slow?

落花浮王杯 提交于 2019-11-27 13:57:32
Davide Ungari

Well it could be a DNS problem. You can disable DNS host name lookups by starting mysqld with the --skip-name-resolve option in the configuration file.

Read here for more details: http://dev.mysql.com/doc/refman/5.0/en/host-cache.html

The --skip-name-resolve worked great for me.

To make it permanent, I just add this line at the end of file my.ini in the [mysql] section:

skip-name-resolve

And voilá! Transactions now fly!

Matt

For me it was this solution I found here, If IP6 connectivity is enabled, connection to "localhost" may be slow, instead use the ip address, 127.0.0.1. This worked for me.

my mysql slow to connect problem was solved by this solution

firewalls, Internet, routing etc etc slows down your connection.

You should put your database on a intra net instead. Keep it local and behind your big firewall. You can of course have firewall and security between computers. I'd recommend that you didn't expose your mysql database connection to the Internet unfiltered that way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!