Symptoms
-
Plesk panel is inaccessible with the error:
500 PleskExceptionDatabase
DB query failed: "SET sql_mode = ''" Error: SQLSTATE[HY000] [2002] Connection refused -
MariaDB service is down and fails to start.
-
The log
/var/log/mariadb/mariadb.log
contains the following:[ERROR] mariadbd: Can't create/write to file '/run/mariadb/mariadb.pid' (Errcode: 2 "No such file or directory")
[ERROR] Can't start server: can't create PID file: No such file or directory
Cause
The directory /var/run/mariadb
does not exist.
Resolution
-
Create the missing directory:
# mkdir /var/run/mariadb
-
Set the correct permissions
# chown -R mysql:mysql /var/run/mariadb/
-
Start MariaDB
# systemctl restart mariadb