MySQL · error reference
MySQL ERROR 2003: Can't connect to MySQL server
ERROR 2003 (HY000): Can't connect to MySQL server on 'db.example.com:3306' (110)
The number in brackets at the end is the operating system's reason, and it splits this error into three different problems.
What the database is telling you
The client never reached a MySQL server. The trailing number is the socket error: 111 (10061 on Windows) means the host refused the connection — nothing listening; 110 (10060 on Windows) means no answer at all — usually a firewall dropping packets; 113 means there is no route to that network.
Why it shows up in a migration
MySQL packages commonly bind to 127.0.0.1 by default, and cloud databases sit behind security groups. Both are invisible until something connects from outside — which a migration always does.
Common causes
- (111) bind-address is 127.0.0.1, so MySQL only accepts local connections; or MySQL runs on another port; or skip_networking is on.
- (110) a firewall or cloud security group drops traffic to 3306 from your address.
- (113) the address is on a private network your client has no route to.
- The host name resolves to an old or internal address.
How to fix it
- 1
On the server, check what MySQL listens on.
SHOW VARIABLES WHERE Variable_name IN ('bind_address', 'port', 'skip_networking'); - 2
For (111): set bind-address = 0.0.0.0 (or the server's private address) under [mysqld] in my.cnf and restart MySQL.
- 3
For (110): allow inbound 3306 from the client's address in the security group or firewall — test from the client with a raw TCP check.
nc -vz db.example.com 3306
- 4
For (113): connect through a bastion or VPN that can reach the private network, rather than opening the database to the internet.
What DBShifts does about it
Connection diagnosis splits these the same way: a refusal is reported as nothing listening on that host and port, a timeout as most likely a firewall with the address to allowlist, and an unreachable network as a routing problem. For a database on a private network, connections can go through an SSH bastion.
Connection diagnosis
Connecting a database?
Add the database to DBShifts and the connection is tested on the spot. If it fails, you get which of these errors it is and what to change — not the driver's raw message. Once it connects, browse it, migrate it, or let an AI agent read it through the gateway with sensitive columns masked.