Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't connect to MySQL server error 113

Trying to make a simple connect to my servers MySQL database and I get

Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL server on '<host>' (113)

netstat -tulpen has a :3306 record

Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      999        801279      32067/mysqld

My bind-address in my.cnf is set to 0.0.0.0 and I still can't manage to connect to a database.

My MySQL users

+------------------+------------------------+
| User             | Host                   |
+------------------+------------------------+
| root             | 127.0.0.1              |
| root             | localhost              |
| root             | <ip>                   |
+------------------+------------------------+

I can connect from the inside of my server.

What i'm missing?

Thank you in advance

like image 254
Jev Avatar asked May 08 '15 15:05

Jev


1 Answers

the 113 error shows "no route to host" error.you must configure your ip address on both machines.
of course,it must be routable.else, it wont work.

like image 77
marc_s Avatar answered Oct 11 '22 13:10

marc_s