Applicable to:
- Plesk for Linux
Symptoms
- Plesk Obsidian running on a RHEL-based operating system
-
Unable to log into the Plesk GUI with the following error:
Server Error
500
Plesk\Exception\Database
DB query failed: SQLSTATE[HY000] [2002] No such file or directory: 0: /usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php:60 -
The MariaDB database server service cannot be started after an attempt to upgrade it to a newer version:
# systemctl status mysqld.service
Unit mysqld.service could not be found.# systemctl status mariadb
Unit mariadb.service could not be found.# systemctl status mysql.service
Unit mysql.service could not be found.
Cause
The update or upgrade for MariaDB failed and did not fully install the latest MariaDB version, due to which the current database server installation is corrupted.
Resolution
-
Connect to a Plesk server via SSH
-
Create a backup of the following Plesk databases:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin psa > /root/psa_backup.sql
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin apsc > /root/apsc_backup.sql -
Backup the MySQL configuration file
my.cnf
by executing the following command:# cp /etc/my.cnf{,_original}
-
Backup the directory
/var/lib/mysql
:# cp -a /var/lib/mysql{,_original}
-
Enable the official MariaDB repository (instructions are available here), but do not install it.
-
Remove the
mysql-server
package:# rpm -e --nodeps `rpm -q --whatprovides mysql-server`
-
Remove all leftovers and install MariaDB packages in one transaction:
# yum shell
> remove mysql mysql-server plesk-mysql
> install MariaDB-server MariaDB-client MariaDB-compat MariaDB-shared
> run
> exit -
Start MySQL:
# service mysql start
-
Upgrade the MySQL installation:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin
-
If Plesk is inaccessible after the database server upgrade, restore the Plesk system databases by executing the following commands:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa < /root/psa_backup.sql
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin apsc < /root/apsc_backup.sql
Comments
0 comments
Please sign in to leave a comment.