ERROR 2002: Can't Connect to Local MySQL Server Through Socket
ERROR 2002 means the MySQL client went looking for a Unix socket file and never reached a server. Here's how to tell a stopped server from a socket in the wrong place, read the number in brackets, and fix it for the CLI, PHP and Python.