Can't Connect to MySQL Server Error 111: Connections Restricted to Localhost
The error "Can't connect to MySQL server on '192.168.1.100' (111)" suggests that your MySQL server is only accepting connections from the localhost interface. This means that you can connect to the database from the local machine itself (using 'localhost' or '127.0.0.1'), but not from other machines on the network.
Difference between localhost/127.0.0.1 and 192.168.1.100
Solution
To enable connections from other machines,你需要修改my.cnf配置文件并取消注释bind-address选项。
sudo vi /etc/mysql/my.cnf
#bind-address = 127.0.0.1
sudo service mysql restart
After restarting MySQL, you will be able to connect to the database from other machines using the external IP address (192.168.1.100).
The above is the detailed content of Why Can't I Connect to My MySQL Server from a Remote Machine (Error 111: Connection Refused)?. For more information, please follow other related articles on the PHP Chinese website!