- Plesk for Linux
Plesk is not accessible. The error below is shown:
PLESK_INFO: Unable to connect to database: Unknown database 'psa'
0: common_func.php3:150 psaerror(string 'Unable to connect to database: Unknown database 'psa'')
Some actions deleted/corrupted Plesk database. psa database currently missing.
Note: This article requires SSH connection to the server. If you don't have SSH credentials or full Plesk access, contact server's administrator or hosting support that hosts your server.
Connect to the server via SSH, login to MySQL server and make sure that psa database exists:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin
mysql> show databases like 'psa';
Empty set (0.00 sec)
If no, check if backup is present in the dump directory:
# grep dump /etc/psa/psa.conf
# ls -lt /var/lib/psa/dumps/mysql.daily.dump*
-rw------- 1 root root 239658 Dec 10 03:37 /var/lib/psa/dumps/mysql.daily.dump.0.gz
-rw------- 1 root root 241242 Dec 9 03:37 /var/lib/psa/dumps/mysql.daily.dump.1.gz
-rw------- 1 root root 241376 Dec 8 03:37 /var/lib/psa/dumps/mysql.daily.dump.2.gz
-rw------- 1 root root 241887 Dec 7 03:38 /var/lib/psa/dumps/mysql.daily.dump.3.gz
Restore the latest daily dump (from Dec. 10 in this case) using the commands below:
# gunzip /var/lib/psa/dumps/mysql.daily.dump.0.gz
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -e "create database psa"
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa < /var/lib/psa/dumps/mysql.daily.dump.0
In case if there is no SSH access to the server, contact Hosting Provider or server's administrator that maintains your server. If MySQL is not accessible with error, visit the following article or search by the mentioned error.