Fixing MySQL "Can't connect to server"
The error Can't connect to MySQL server on 'localhost' (10061) usually means the service isn't running.
Start the MySQL Service
Before trying to connect, ensure the daemon is active.
MacOS (Homebrew):brew services start mysql
Windows (CMD as Admin):
net start mysql80
2. Check Port Bindings
If you have XAMPP or Docker running, they might have grabbed port 3306 first.
# Check what is using 3306
lsof -i :3306