DBAtlas · Database operations atlas

2003: Can't connect to MySQL server (TCP/IP)

MySQL

What does it mean?

The client could not connect to the MySQL server over TCP/IP on the specified host and port.

Why does it happen?

The server is not running, wrong host/port, a firewall blocking port 3306, the server bound only to localhost (bind-address = 127.0.0.1) or skip-networking enabled.

How to fix it

Check that the server is up and listening on the correct port. For remote access, set bind-address = 0.0.0.0 (or the appropriate IP) in my.cnf and make sure skip-networking is off. Open port 3306 in the firewall. Verify host/port: mysql -h host -P 3306 -u app_user -p. Make sure the user has privileges from the remote host.

Open in DBAtlas →

More from this engine