2003 🐬 MySQL

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

  1. Check the service and port (ss -ltnp | grep 3306)
  2. Set bind-address = 0.0.0.0 (with proper users/firewall)
  3. Open 3306 only to trusted IPs

Detailed fix by platform

Linux

  1. sudo ss -ltnp | grep 3306 && grep bind-address /etc/mysql/mysql.conf.d/mysqld.cnf

How to diagnose

  1. Code — 111/110/113?
  2. 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.