RoundCube webmail is not accessible: DATABASE ERROR: CONNECTION FAILED

Created:

2016-11-16 13:20:50 UTC

Modified:

2017-08-08 13:43:29 UTC

1

Was this article helpful?


Have more questions?

Submit a request

RoundCube webmail is not accessible: DATABASE ERROR: CONNECTION FAILED

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

RoundCube webmail page is not accessible, the following error message is displayed

DATABASE ERROR: CONNECTION FAILED
DB Error: SQLSTATE[28000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) (GET /roundcube/index.php)

Cause

MySQL roundcube user is either absent or have an invalid password or have not sufficient permissions.

Resolution

  1. Backup mysql database:

    # plesk db dump mysql > mysql.dump.`date +%F.%s`.sql
  2. Get database password from /usr/share/psa-roundcube/config/config.inc.php :

    # cat /usr/share/psa-roundcube/config/config.inc.php

    <?php
    // Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
    $config = array();
    $config['db_dsnw'] = 'mysqli://roundcube:password@localhost/roundcubemail';
  3. Login to mysql and check whether the roundcube user is present. Empty output means that the user is absent:

    # plesk db "select * from mysql.user where user='roundcube'"
  4. Create user and grant it necessary privileges:

    # plesk db

    mysql> CREATE USER 'roundcube'@'localhost';
    mysql> begin;
    mysql> update mysql.user set password=password('password_from_config.inc.php') where user ='roundcube';
    mysql> commit;
    mysql> GRANT USAGE ON *.* TO 'roundcube'@'localhost'
    mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `roundcubemail`.* TO 'roundcube'@'localhost'
    mysql> flush privileges;
Have more questions? Submit a request
Please sign in to leave a comment.