MySQL error 2002 - Can't connect through socket

You may see this error in your agent logs.

This article is for our v1 agent and will soon be deprecated.

main - ERROR - getMySQLStatus: MySQL connection error: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")

As per the MySQL documentation this "normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service."

One solution describes how to change the permissions of the sock file so that this will work properly.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.