Cannot open Plesk: ERROR: PleskFatalException Unable to connect to database: Unknown database psa

Created:

2016-11-16 12:46:56 UTC

Modified:

2017-05-10 07:20:45 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Cannot open Plesk: ERROR: PleskFatalException Unable to connect to database: Unknown database psa

Applicable to:

  • Plesk for Linux
  • Plesk 11.0 for Windows

Symptoms

Plesk is not accessible. The error below is shown:

ERROR: PleskFatalException
Unable to connect to database: Unknown database 'psa'

0: common_func.php3:150
psaerror(string 'Unable to connect to database: Unknown database 'psa'')
1: auth.php3:111

Cause

The psa database does not exist.

Resolution

  1. Log in to MySQL and check if the psa database exists:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin

    mysql> show databases like 'psa';
    Empty set (0.00 sec)

    So, at this point, you need to restore the database from the latest available backup on the server.

  2. Check if backups exist in the dump directory:

    ~# grep dump /etc/psa/psa.conf
    DUMP_D /var/lib/psa/dumps

    ~# ls -la # 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
    -rw------- 1 root root 237143 Dec 6 03:38 /var/lib/psa/dumps/mysql.daily.dump.4.gz
    -rw------- 1 root root 233966 Dec 5 03:36 /var/lib/psa/dumps/mysql.daily.dump.5.gz
    -rw------- 1 root root 233495 Dec 4 03:38 /var/lib/psa/dumps/mysql.daily.dump.6.gz
    -rw------- 1 root root 232856 Dec 3 03:36 /var/lib/psa/dumps/mysql.daily.dump.7.gz
    -rw------- 1 root root 232710 Dec 2 03:36 /var/lib/psa/dumps/mysql.daily.dump.8.gz
  3. 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 you do not have access to the MySQL please contact your Hosting provider.

Have more questions? Submit a request

1 Comments

Please sign in to leave a comment.