MySQL Error

Hello,

I have a Raspberry Pi 3 running FreePBX and everything was working fine until yesterday it broke out of nowhere and now the only thing I get is this error. Nothing online seemed to help so I’m hoping you all could point me in the right direction.

SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)::SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Thanks.

Really? This question comes up here every couple of weeks, and I’m sure it happens every day on the MySQL forums.

MySQL broke and isn’t starting. Find the ‘my.cnf’ file and see where the error logs are being created. Tail the error log (something like “tail -200 /var/mysql/hostname*err | more”) and see what the error is.

Chances are, it’s because you’re running on a RasPI - the database churns on the database files a lot and the SD-Cards in the RP can’t handles the read-write cycle.

This error can also occur if storage is full.

1 Like

Yup, and the error log should let you know about that as well.

The ‘df’ command from the system console will give you a quick look into your disk health.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.