Connecting to MySQL: Resolving ERROR 2003 (HY000) When Using '127.0.0.1'
Connecting to MySQL using the command mysql -u root -h 127.0.0.1 -p can result in the error message:
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
Solution for Ubuntu Users:
For Ubuntu systems, follow these steps to resolve this error (when replication is not enabled):
If bind-address is not found in my.cnf, check for it in /etc/mysql/mysql.conf.d/mysqld.cnf.
In Case of MySQL Replication:
If MySQL replication is enabled, try connecting to the server using the IP address for which the server is bound in the my.cnf file, instead of localhost or 127.0.0.1.
The above is the detailed content of Why Can't I Connect to My MySQL Server Using '127.0.0.1' and How Do I Fix ERROR 2003 (HY000)?. For more information, please follow other related articles on the PHP Chinese website!