Lost connection to MySQL server at 'reading initial communication packet', system err
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
On a default installation, depending the distro you use, the file you need to check is found in /etc/mysql and named my.cnf.
If that directory doesn't exist, look for the file using find / -name 'my.cnf' and you'll know where it is.
So 'cd' to the directory or edit using your favorite editor (vi, nano, ...).
Look for the line that says
If that is set to 127.0.0.1 or something else, change it to the IP of your server. The IP of your server should be known by you, or can be found using 'ifconfig' command (on Debian) or with 'ip addr sh eth0' for the first network card.
After changing the my.cnf file you need to reboot the MySQL server, normally using '/etc/init.d/mysql restart'