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.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Lost connection to MySQL server at 'reading initial communication packet', system err
Hi All,
I am connecting mysql database server through php script remotly. PHP files on other server and the database is on another. While trying to connect, i get this error message below.
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 113
Please suggest me how to get it connected.
Thanks in advance
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
bind-address =
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'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.