Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
Plesk is not accessible with the following error messages in a web-browser:
PLESK_INFO: Unknown database 'psa'
Cause
The Plesk system database psa
is missing.
Resolution
Restore the psa
database from a daily dump:
-
Connect to the Plesk server via SSH.
-
Switch to the directory with daily dumps:
# cd /var/lib/psa/dumps
-
Find the most recent dump that contains the
psa
database:# zgrep "Current Database:" mysql.daily* | grep psa
mysql.daily.dump.0.gz:-- Current Database: `psa`
mysql.daily.dump.1.gz:-- Current Database: `psa`
mysql.daily.dump.2.gz:-- Current Database: `psa`
mysql.daily.dump.3.gz:-- Current Database: `psa`
...-
where
mysql.daily.dump.0.gz
is the most recent daily dump.
-
-
Restore the
psa
database from the most recent daily dump. In this example, thepsa
database is restored frommysql.daily.dump.0.gz
:# zcat mysql.daily.dump.0.gz | sed -n '/-- Current Database: `psa`/,/-- Current Database:*/p' | MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin
-
Open Plesk in a web-browser.
-
Connect to the Plesk server via RDP.
-
Connect to MySQL:
Note: MySQL admin password is required for this operation. In Plesk Onyx 17.8 and later, retrieve the password with the command
plesk sbin psadb --get-admin-password
.C:\> "%plesk_dir%\Mysql\bin\mysql.exe" apsc -uadmin -p -P8306
-
Once connected, create a new database with the name
psa
:MYSQL_WIN: mysql> create database psa;
-
Exit MySQL:
MYSQL_WIN: mysql> quit
-
Switch to the directory with daily dumps:
C:\> cd %plesk_dir%Mysql\Backup
-
List a name of a Plesk dump with the
psa
database:C:\> dir psa*
...
Directory of C:\Program Files (x86)\Plesk\MySQL\Backup
03/27/2019 08:33 PM 468,888 psa-20181018020721.sql -
Restore the
psa
database using the dump file name from the previous step:Note: MySQL admin password is required for this operation.
C:\> "%plesk_dir%"\Mysql\bin\mysql.exe -uadmin -p -P8306 psa < psa-20181018020721.sql
-
Open Plesk in a web-browser.
Comments
6 comments
Thank you.
I have executed the command and I have the following error:
ERROR 1005 (HY000) at line 15: Can't create table 'APSApplicationItems' (errno: 28)
Thanks!
@Enrique Ruiz Millan
Seems there is a complex issue with the database. Consider submitting a support request to Plesk directly or to a reseller, depending on where the license was purchased.
IMHO it would be safer to not automatically remove the psa database when Plesk packages are removed. Print a message instead that this has to be done manually (or give out the command to do it). I had to restore from backup when apt accidentally removed Plesk packages as a side effect.
Hello Lars Doe,
Thank you for sharing your experience.
In this case, I can suggest creating a suggestion at Plesk User-voice portal.
This article does not lead to a solution.
When I type command: zgrep "Current Database:" mysql.daily* | grep psa
I get not results, even tough I have 8 (eight) daily dumps.
Where to go from here to recover the psa table, which I got from the following error?
SQLSTATE[HY000] [1049] Unknown database 'psa'
Please sign in to leave a comment.