metricsign
Start free
Critical severityconnection

Power BI Refresh Error:
2002

What does this error mean?

The MySQL client cannot find the Unix socket file — usually because MySQL is not running or the socket path is wrong.

Common causes

  • 1MySQL server is stopped or crashed
  • 2The socket file path configured in the client does not match the actual socket path in my.cnf
  • 3MySQL failed to start due to a configuration error or disk full condition
  • 4The /tmp or /var/run/mysqld directory has wrong permissions

How to fix it

  1. 1Step 1: Check if MySQL is running: `systemctl status mysql` or `service mysql status`.
  2. 2Step 2: Start MySQL if stopped: `sudo systemctl start mysql`.
  3. 3Step 3: Verify the socket path: `grep socket /etc/mysql/my.cnf` and ensure the client uses the same path.
  4. 4Step 4: Check MySQL error logs for startup failures: `sudo journalctl -u mysql -n 50`.

Frequently asked questions

Where is the MySQL socket file located?

Typically `/var/run/mysqld/mysqld.sock` on Debian/Ubuntu or `/tmp/mysql.sock` on other systems. Check `SHOW VARIABLES LIKE 'socket';` when connected.

MySQL starts but the socket error persists — what now?

Check if the client's `[client]` section in my.cnf specifies a different `socket` path than the server's `[mysqld]` section. They must match.

How can I monitor MySQL server availability through MetricSign?

MetricSign monitors ADF pipeline runs. When MySQL is down, pipeline failures are immediately surfaced as incidents with the connection error detail.

Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html

Other connection errors