Lost connection to MySQL server while "reading source communication packet", system error: 113

I have two Debian windows:

  • used apt-get to install mysql server mysql-client phpmyadmin
  • used apt-get to install apache2 apache2-mod-php5

I am trying to connect to a MySQL server using Apache, but I am getting this error from PHP:

Lost connection to MySQL server while "reading source communication packet", system error: 113

I can connect to MySQL using a Windows client on the same network. This makes me think about how Apache2 / PHP is configured.

Additional reading about error 113 makes you think about host names, etc. The my.cnf on MySQL field is set to bind-address = 192.168.1.202, and PHP is trying to connect to 192.168.1.202.

Any help is much appreciated! I am not an evil genius with a long shot, and this is my first time trying to use only the way to establish this. I bet I forgot something stupid.

+3
source share
2 answers

I am using Ubuntu 11.04

I logged in as root and ran

cd /etc/mysql
nano my.cnf

Then I found bind-address = 127.0.0.1and added in front of it #so that it looked like#bind-address = 127.0.0.1

Than I started /etc/init.d/mysql restartto restart MySQL. Then he began to work.

Hope this helps. I know that Debian and Ubuntu are about the same when working.

+2
source

Verify that the IP address you are trying to connect to is correct and not a firewall

0
source

Source: https://habr.com/ru/post/1795807/


All Articles