mysql client connection attempt to mysql server very slow
computer A with ip 192.168.10.5 has mysql client on it and computer B with ip 192.168.10.6 has the mysql server. mysql client on computer A try to connect to mysql server on computer B :
$ mysql -u username -p -h 192.168.5.6
it takes at least 5 seconds before mysql prompt show up on the screen after entering password. this can be a problem when computer A is hosting a web application which needs to read it’s database on compter B. page generation would take very long time even when a lot of bandwidth are available. the solution to this problem is very simple. open /etc/hosts file on computer B and add the ip of computer A like this :
192.168.10.5 192.168.10.5
save and exit. now the connection attemp should be faster and mysql prompt will show up on the screen in a second. this might be applied to other application too, like ssh for example.

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=9b048c8c-ea5c-4f8b-bbe1-e71a4dcd767b)






July 8th, 2010 at 6:45 pm
Thanks, great post. Solved my SQL connection problems.
For SSH you can edit the sshd_conf file and add UseDNS No.
___
EGC