Answer the question
In order to leave comments, you need to log in
How to fix sudden error 2002 (HY000) mysql - mariadb under Mac OS Big Sur?
Given - local server, under Mac OS Big Sur, nginx, mariadb, php-fpm , everything was installed with homebrew .
Installed and working for a long time, since the spring from the first quarantine days, the last time everything was updated in October after updating the system to Big Sur. Until today, everything worked like clockwork, this morning I open it in the browser and get an error:
PDOException: SQLSTATE[HY000] [2002] No such file or directory in /usr/local/.....
mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
@Alexanders-MacBook-Pro var % mysqladmin -u root -p status
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
@Alexanders-MacBook-Pro /tmp % mysqld --help --verbose | grep sock
socket /tmp/mysql.sock
unix-socket ON
Answer the question
In order to leave comments, you need to log in
try restarting, or first check if
brew services status mysql is running
then stop / start
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question