• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Server Error 500 Zend_Db_Adapter_Exception SQLSTATE[HY000] [2002] No such file or directory

Fx17

New Pleskian
Hello,
Following an update from Plesk 17.5.3 to version 17.8.11 update#6; I can not access Plesk's control panel anymore.

I get a 500 error with the following message:
Server Error 500
Zend_Db_Adapter_Exception
SQLSTATE[HY000] [2002] No such file or directory
Type Zend_Db_Adapter_Exception
Message SQLSTATE[HY000] [2002] No such file or directory
File Abstract.php
Line 144

plesk-repair-kit-14052018.jpg


I used the "repair kit" to identify the problem and apparently the "mysql.service" is out of order. Using the SSH command "service mysql status" I get the following message:
root@prod1:~# service mysql status
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since lun. 2018-05-14 15:16:18 CEST; 21min ago
Process: 28302 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

mai 14 15:15:48 prod1.mx17.fr mysqld[28471]: 180514 15:15:48 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.36-82.1 started; log sequence number 179373574917
mai 14 15:15:48 prod1.mx17.fr mysqld[28471]: 180514 15:15:48 [Note] Plugin 'FEEDBACK' is disabled.
mai 14 15:15:48 prod1.mx17.fr mysqld[28471]: 180514 15:15:48 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
mai 14 15:15:48 prod1.mx17.fr mysqld[28471]: 180514 15:15:48 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
mai 14 15:15:48 prod1.mx17.fr mysqld[28471]: 180514 15:15:48 [Note] Server socket created on IP: '127.0.0.1'.
mai 14 15:15:48 prod1.mx17.fr mysqld[28471]: 180514 15:15:48 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
mai 14 15:16:18 prod1.mx17.fr mysql[28302]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
mai 14 15:16:18 prod1.mx17.fr systemd[1]: mysql.service: control process exited, code=exited status=1
mai 14 15:16:18 prod1.mx17.fr systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
mai 14 15:16:18 prod1.mx17.fr systemd[1]: Unit mysql.service entered failed state.
I feel that the problem comes from MySQL!
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

How should I proceed to solve this problem?
 
Last edited:
Here is the result of the SSH command "service mysql status" :
root@prod1:~# service mysql status
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since mar. 2018-05-15 06:25:31 CEST; 4h 0min ago
Process: 13989 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

mai 15 06:25:01 prod1.mx17.fr mysqld[14158]: 180515 6:25:01 [Note] InnoDB: Percona XtraDB (Experts in Database Performance Management) 5.6.36-82.1 started; log sequence number 179373574917
mai 15 06:25:01 prod1.mx17.fr mysqld[14158]: 180515 6:25:01 [Note] Plugin 'FEEDBACK' is disabled.
mai 15 06:25:01 prod1.mx17.fr mysqld[14158]: 180515 6:25:01 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
mai 15 06:25:01 prod1.mx17.fr mysqld[14158]: 180515 6:25:01 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
mai 15 06:25:01 prod1.mx17.fr mysqld[14158]: 180515 6:25:01 [Note] Server socket created on IP: '127.0.0.1'.
mai 15 06:25:01 prod1.mx17.fr mysqld[14158]: 180515 6:25:01 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
mai 15 06:25:31 prod1.mx17.fr mysql[13989]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
mai 15 06:25:31 prod1.mx17.fr systemd[1]: mysql.service: control process exited, code=exited status=1
mai 15 06:25:31 prod1.mx17.fr systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
mai 15 06:25:31 prod1.mx17.fr systemd[1]: Unit mysql.service entered failed state.
 
The same problem under Linux Solved:
I had the same problem in my server and found out it was due to some virus which is related to read write permission in some web-based files. the approach I took was first:
1. Download a fresh Ubuntu latest version live cd.
2. Make a bootable Ubuntu thumb drive.
3. Boot your server from the live cd.
4. Choose try Ubuntu with your internet connected.
5. When it boots up open the terminal program & type the following command:
sudo apt install clamav
sudo freshclam
Don't bother if freshclam command gives an error because your virus database might not need update.​
6. Now you need to find a place where the root directory of your server is located. Usually it will be in /mnt directory.
7. Now use the following command to scan the root directory of your server.
clamscan -r --bell -i /mnt/your root directory​
8. After scanning is done viruses will be removed & corrupted files will be repaired.
9. Disconnect the server from the Internet and reboot it.
10. Login to the server a sure that the main domain and the sub-domains in the /var/www/vhosts/nsxxxxxxx/ has the right read write permission and it's better to default all files to 644 and directories to 755 and it's done this way:
cd /var/www/vhosts/nsxxxxxxxx "where xxxxxxx is the domain name"
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;​
11. Reboot the server and connect it to the internet
12. Now you must be able to access Plesk normally.
13. Now check which directory needs other read and write permission. Some might need 707 permission like image directories and some might need chown apache:apache or
chown www-data:www-data like cache directories in the domains and sub-domains.
I hope this will help & thank you plesk team.
 
Back
Top