Symptoms
-
Roundcube webmail fails to open with this error:
Database error: connection failed!
Unable to connect to database!
Please contact your server-administrator. - Removing mailbox in Plesk fails with the following error:
DB query failed: SQLSTATE[42S02]: Base table or view not found: 1146
Table 'roundcubemail.users' doesn't exist, query was: DELETE FROM
`roundcubemail`.`users` WHERE (username = '[email protected]) -
Steps from the article did not help
Cause
The roundcubemail
database is corrupted
Resolution
Restore the RoundCube database from a daily dump
-
Connect to the server via SSH
-
Switch to the directory with daily dumps:
# cd /var/lib/psa/dumps
-
List all available Plesk daily dumps:
# ls -l mysql.daily*
-rw------- 1 root root 236253 Feb 3 01:51 mysql.daily.dump.0.gz
-rw------- 1 root root 229653 Feb 2 01:48 mysql.daily.dump.1.gz
-rw------- 1 root root 222485 Feb 1 01:56 mysql.daily.dump.2.gzNote: The file
mysql.daily.dump.0.gz
is the most recent dump. -
Restore the
roundcubemail
database from the most recent daily dump:# zcat mysql.daily.dump.0.gz | sed -n '/-- Current Database: `roundcubemail`/,/-- Current Database:*/p' | MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin --default-character-set=utf8
Warning: In case the above solution did not help:
Reinstall the RoundCube webmail client
-
Drop the database
# plesk db "drop database roundcubemail;"
-
Reinstall the RoundCube webmail following steps from the article: How to install / uninstall Plesk components