Troubleshooting: Error 111 - Unable to connect to MySQL server
<p>I installed the MySQL server on a Linux host with the IP address 192.168.1.100, but when I try to connect to this IP, I always get an error (111). But using localhost and 127.0.0.1 is ok. </p>
<pre>beer@beer-laptop# ifconfig | grep "inet addr"
inet addr:127.0.0.1 Mask:255.0.0.0
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
beer@beer-laptop# mysql -ubeer -pbeer -h192.168.1.100
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.100' (111)
beer@beer-laptop# mysql -ubeer -pbeer -hlocalhost
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 160
Server version: 5.1.31-1ubuntu2 (Ubuntu)
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql>
beer@beer-laptop# mysql -ubeer -pbeer -h127.0.0.1
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 161
Server version: 5.1.31-1ubuntu2 (Ubuntu)
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql>
</pre>
<p>Error 111 also occurs when connecting from another machine. </p>
<pre>another@another-laptop# mysql -ubeer -pbeer -h192.168.1.100
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.100' (111)
</pre>
<p>In this case, what is the difference between using localhost or 127.0.0.1 versus using 192.168.1.100? I don't know how to connect to this database from another machine. <br /><br />Please help, thank you. </p><p><br /></p>