Applicable to:
- Plesk for Linux
Symptoms
-
Plesk login page shows the following error:
CONFIG_TEXT:
ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] Connection refused
-
In
/var/log/mysqld.log
the following error can be found:CONFIG_TEXT: [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2 - No such file or directory)
-
The following error may be found in
/var/log/mariadb/mariadb.log
file:CONFIG_TEXT: [ERROR] mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 2)
[ERROR] Can't start server: can't create PID file: No such file or directory
mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
CONFIG_TEXT:2020-08-05 1:04:22 0 [ERROR] mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 13 "Permission denied")
2020-08-05 1:04:22 0 [ERROR] Can't start server: can't create PID file: Permission denied -
Directory
/var/run/mysqld
(for Debian and Ubuntu) or/var/run/mariadb/
(for CentOS) is absent or has incorrect permissions:Debian and Ubuntu:
# ls -lad /var/run/mysqld
ls: cannot access /var/run/mysqld: No such file or directoryCentOS:
# ls -lad /var/run/mariadb/
ls: cannot access '/var/run/mariadb/': No such file or directory
Cause
MySQL directory is absent so the system cannot create PID file for the service on startup.
Resolution
Note: This article may require additional administrative knowledge to apply. If any help required, contact server’s administrator or hosting support.
-
Connect to the server via SSH.
-
Create the configuration file with necessary content:
-
For Debian/Ubuntu:
# echo "d /var/run/mysqld 0755 mysql mysql -" >> /etc/tmpfiles.d/mysql.conf
-
For CentOS/RHEL/CloudLinux:
# echo "d /var/run/mariadb 0755 mysql mysql -" >> /etc/tmpfiles.d/mysql.conf
-
-
Reboot the server.
Click on a section to expand
-
Connect to the server via SSH.
-
Run the commands below:
# install -dpm770 -o mysql -g mysql /var/run/mariadb
# systemctl start mariadb
Comments
1 comment
pb not fixed
Please sign in to leave a comment.