Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

mysqld_safe Directory ‘/var/run/mysqld’ for UNIX socket file don’t exists

We got this error on a server we were tasked with for recovery MySQL server’s root password:

mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists

The fix for this turns out to be pretty straight forward, the directory it complains about doesn’t exist. Create the directory and all is good:

mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld

Issue the command again and it should be able to start-up in safe mode without a problem:

mysqld_safe --skip-grant-tables --skip-networking &