Fix fix roundcude DATABASE ERROR: CONNECTION FAILED!

When logging into the Roundcude email in the CWP control panel , the following error message appears: ▼

DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!
Please contact your server-administrator.

Fix fix roundcude DATABASE ERROR: CONNECTION FAILED!

Check for roundcude database errors

Please check the Roundcude error log file ▼

/usr/local/cwpsrv/var/services/roundcube/logs/errors

If your error looks like this ▼

[17-May-2021 20:18:11 +0000]: <gv4343g> DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) in /usr/local/cwpsrv/var/services/roundcube/program/lib/Roundcube/rcube_db.php on line 173 (GET /roundcube/)
[17-May-2021 20:18:11 +0000]: <gv4343g> DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) (GET /roundcube/)

Check the roundcube config file

Check the password set in the roundcube configuration file  /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php

grep db_dsnw /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php

The output will be like this ▼

$config['db_dsnw'] = 'mysqli://roundcube:42Etn3fd7skc@localhost/roundcube';
  • This indicates that the password is 42Etn3fd7skc

Now let's set the same value in MySQL ▼

mysql -e "SET PASSWORD FOR 'roundcube'@'localhost' = PASSWORD('42Etn3fd7skc');"
mysql -e "FLUSH PRIVILEGES;"

Check if roundcube works?

Now, check again if roundcube works?

If this error occurs ▼

[17-May-2021 20:29:09 +0000]: <gv91fd30g> DB Error: [1146] Table 'roundcube.session' doesn't exist (SQL Query: SELECT `vars`, `ip`, `changed`, now() AS ts FROM `session` WHERE `sess_id` = 'gv93bfdsfdffdfdj3') in /usr/local/cwpsrv/var/services/roundcube/program/lib/Roundcube/rcube_db.php on line 539 (GET /roundcube/)

run this command ▼

mysql -u root 'roundcube' < /usr/local/cwpsrv/var/services/roundcube/SQL/mysql.initial.sql

That's it, enjoy your roundcude.

In addition, there is another error that is different from the above error, the solution and repair method, please browse the article link below▼

Comment

Your email address will not be published. Required fields are marked with * .

Scroll to Top