MySQL ERROR 2003 (HY000): Can't connect to MySQL server on 'host:3306' (111)
The client couldn’t reach MySQL over TCP — server down, wrong host/port, firewall, or MySQL bound to localhost only.
Seen on:
MySQL
Meaning
The number in parentheses is the OS error: 111 = connection refused, 110 = timed out, 113 = no route. Remote access needs bind-address set and the port open.
Common causes
- MySQL not running
- bind-address = 127.0.0.1 while connecting remotely
- Firewall/security group blocking 3306
- Wrong host/port
⚡ Quick fix
- Check the service and port (ss -ltnp | grep 3306)
- Set bind-address = 0.0.0.0 (with proper users/firewall)
- Open 3306 only to trusted IPs
Detailed fix by platform
Linux
sudo ss -ltnp | grep 3306 && grep bind-address /etc/mysql/mysql.conf.d/mysqld.cnf
How to diagnose
- Code — 111/110/113?
- Listener — Which address?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026