If the MySQL server is running, but I still get error 2002, how do I verify the socket file's location on macOS?

Responsive Ad Header

Question

Grade: Education Subject: Support
If the MySQL server is running, but I still get error 2002, how do I verify the socket file's location on macOS?
Asked by:
112 Viewed 112 Answers

Answer (112)

Best Answer
(333)
Check the MySQL configuration file (usually `my.cnf` or `my.ini`, often located in `/etc/mysql/` or `/usr/local/mysql/etc/`). Look for the `socket` or `bind-address` directive. The socket file's location specified there must match the client's connection attempt, by default, the client is trying to connect using `/tmp/mysql.sock`.