Road to Drupal 8

PHP -> Symfony -> Drupal 8

PDOException: SQLSTATE[HY000] [2002] No such file or directory in lock_may_be_available()

Este es un problema del servidor mas que de drupal, en mi caso era que mysql no arrancaba.

En la pagina de drupal se podía ver el error PDOException: SQLSTATE[HY000] [2002] No such file or directory in lock_may_be_available()

150415 9:30:51 [Note] /usr/sbin/mysqld: ready for connections.
150415 09:30:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150415 09:30:32 mysqld_safe mysqld from pid file /var/lib/mysql/***********.pid ended
150415 9:30:32 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashed and should be repaired
150415 09:30:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150415 09:30:25 mysqld_safe mysqld from pid file /var/lib/mysql/***********.pid ended
150415 9:30:25 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashed and should be repaired
150415 09:30:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150415 09:30:18 mysqld_safe mysqld from pid file /var/lib/mysql/***********.pid ended
150415 9:30:18 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashed and should be repaired
150415 09:30:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150415 09:30:11 mysqld_safe mysqld from pid file /var/lib/mysql/***********.pid ended
150415 9:30:11 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashed and should be repaired
150415 09:30:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150415 09:28:32 mysqld_safe mysqld from pid file /var/lib/mysql/***********.pid ended
150415 9:28:32 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashed and should be repaired
150415 09:28:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150415 09:28:25 mysqld_safe mysqld from pid file /var/lib/mysql/***********.pid ended
150415 9:28:25 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashed and should be repaired

 

 

En los logs

En mi servidor en /var/lib/mysql leyendo los archivos de errores

nano ********.err buscando este error

2:12:14 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/db' is marked as crashed and $

Encontre la solución aquí https://forums.cpanel.net/threads/mysql-is-not-running.407142/

myisamchk /var/lib/mysql/mysql/db.MYI

Como necsitaba reparaciones adiccionales

myisamchk -r /var/lib/mysql/mysql/db.MYI