Plesk

Accessing the RoundCube webmail fails with the following error: DATABASE ERROR: CONNECTION FAILED!

Symptoms

Cause

The roundcubemail database is corrupted

Resolution

Restore the RoundCube database from a daily dump

  1. Connect to the server via SSH

  2. Switch to the directory with daily dumps:

    # cd /var/lib/psa/dumps

  3. 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.gz

    Note: The file mysql.daily.dump.0.gz is the most recent dump.

  4. 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

  1. Drop the database

    # plesk db "drop database roundcubemail;"

  2. Reinstall the RoundCube webmail following steps from the article: How to install / uninstall Plesk components