sudo chown mysql:mysql /var/run/mysqld code example
Example: mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld
mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld