If you get this error message on your roundcube link:
DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!
Please contact your server-administrator.
Check roundcube logs in file: /usr/local/cwpsrv/var/services/roundcube/logs/errors
In case that your error looks like this
[17-May-2017 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-2017 20:18:11 +0000]: <gv4343g> DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) (GET /roundcube/)
Check the password set in roundcube config in file /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php
grep db_dsnw /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php
Output will be like this
$config['db_dsnw'] = 'mysqli://roundcube:42Etn3fd7skc@localhost/roundcube';
** This means that your password is 42Etn3fd7skc
Now lets set the same in mysql.
mysql -e "SET PASSWORD FOR 'roundcube'@'localhost' = PASSWORD('42Etn3fd7skc');"
mysql -e "FLUSH PRIVILEGES;"
Now again check if roundcube works.
In case you get this error:
[17-May-2017 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 is it, enjoy your roundcube.