• 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

Help MySQL Problem

U

user1599

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

0: /usr/local/psa/admin/plib/common_func.php3:151
psaerror(string 'Unable to connect to database: Unknown database 'psa'')
1: /usr/local/psa/admin/auto_prepend/auth.php3:90


what can i do to fix this, I cant access my plesk panel?

I think my MYSQL database got damaged and lost the files, I am not sure though. Is there anyway to reinstall the database of plesk?

I do have a mysql.daily.dump can i restore it with this?
 
Please click one of the Quick Reply icons in the posts above to activate Quick Reply.
 
So, the Plesk database is called 'psa', and you can check if it's present:

> mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa

Likely, you get:
ERROR 1049 (42000): Unknown database 'psa'
which means the database was dropped or renamed, it can be checked:
> mysql -uadmin -p
Enter password: {PLESK_ADMIN_PASS}
mysql> show databases;

Look if the InnoDB (or else) files are there:

> ls -la /var/lib/mysql/psa
ls: /var/lib/mysql/psa: No such file or directory

Okay, now you need to restore psa database from a backup. See if some daily mysql dumps of 'psa' database are safe:

> ls -la /var/lib/psa/dumps/
total 1080
drwxr-xr-x 5 psaadm psaadm 4096 Mar 23 04:07 .
drwxr-xr-x 3 root root 4096 Mar 18 21:56 ..
drwx------ 4 psaadm psaadm 4096 Mar 21 13:07 1
drwx------ 4 psaadm psaadm 4096 Mar 22 21:19 2
-rw------- 1 root root 111891 Mar 23 04:07 mysql.daily.dump.0.gz
-rw------- 1 root root 109742 Mar 22 04:05 mysql.daily.dump.1.gz
-rw------- 1 root root 108526 Mar 21 04:04 mysql.daily.dump.2.gz
-rw------- 1 root root 99162 Mar 18 22:53 mysql.preupgrade.dump.gz
-rw------- 1 root root 95501 Mar 18 21:56 mysql.preupgrade.dump.gz.1

Uff, the backups are safe. Now, just restore it: http://kb.swsoft.com/en/881
Good luck.
 
So, the Plesk database is called 'psa', and you can check if it's present:

> mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa

Likely, you get:
ERROR 1049 (42000): Unknown database 'psa'
which means the database was dropped or renamed, it can be checked:
> mysql -uadmin -p
Enter password: {PLESK_ADMIN_PASS}
mysql> show databases;

Look if the InnoDB (or else) files are there:

> ls -la /var/lib/mysql/psa
ls: /var/lib/mysql/psa: No such file or directory

Okay, now you need to restore psa database from a backup. See if some daily mysql dumps of 'psa' database are safe:

> ls -la /var/lib/psa/dumps/
total 1080
drwxr-xr-x 5 psaadm psaadm 4096 Mar 23 04:07 .
drwxr-xr-x 3 root root 4096 Mar 18 21:56 ..
drwx------ 4 psaadm psaadm 4096 Mar 21 13:07 1
drwx------ 4 psaadm psaadm 4096 Mar 22 21:19 2
-rw------- 1 root root 111891 Mar 23 04:07 mysql.daily.dump.0.gz
-rw------- 1 root root 109742 Mar 22 04:05 mysql.daily.dump.1.gz
-rw------- 1 root root 108526 Mar 21 04:04 mysql.daily.dump.2.gz
-rw------- 1 root root 99162 Mar 18 22:53 mysql.preupgrade.dump.gz
-rw------- 1 root root 95501 Mar 18 21:56 mysql.preupgrade.dump.gz.1

Uff, the backups are safe. Now, just restore it: http://kb.swsoft.com/en/881
Good luck.

Actual link is like this:
http://kb.parallels.com/en/881

--------------
Plesk for Linux:
Automatic Plesk database dumps are stored in the directory defined by the DUMP_D variable value in the /etc/psa/psa.conf file.
Automatic dumps consist of two types:
Daily dumps, which are made every night together with the running of the statistics utility; dump files have names like mysql.daily.dump.1.gz
Pre-upgrade dumps, which are made when the Plesk package update is run; names are similar to mysql.preupgrade.dump.gz.1
If you want to perform the database backup manually, it can be done with the command below:
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` DATABASE_NAME > FILE_NAME.sql
The following example shows how to restore the mysql.preupgrade.dump.gz backup file.
# gunzip /var/lib/psa/dumps/mysql.preupgrade.dump.gz
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e"DROP DATABASE psa;"
mysql -f -uadmin -p`cat /etc/psa/.psa.shadow` < /var/lib/psa/dumps/mysql.preupgrade.dump
Actually, a standard daily backup file includes a dump of three databases:
psa
horde
mysql
That is why the following error message may appear when you perform this command:
ERROR 1050 at line 3165: Table 'horde_categories' already exists
It happens because only the psa database needs to be restored. If you need to restore all three of these databases, then you have to delete them before restoration using the DROP DATABASE SQL command.
Plesk for Windows:
Automatic Plesk database dumps are stored in the "%plesk_dir%"\Mysql\Backup
If you want to perform the database backup manually, it can be done with the command below (run Windows command prompt as Administrator):
"%plesk_dir%"\Mysql\bin\mysqldump.exe -uadmin -p<plesk_admin_password> -P8306 DB_NAME > backup_name.sql
The following example shows how to restore the "%plesk_dir%"\MySQL\Backup\psa-20131202194200.sql` backup file:
"%plesk_dir%"\Mysql\bin\mysql.exe -uadmin -p<plesk_admin_password> -P8306 psa < "%plesk_dir%"\Mysql\Backup\psa-20131207194200.sql
 
Back
Top