Roundcube Community Forum

 

DB Error after 1.60 upgrade

Started by DSV12, August 01, 2022, 03:47:39 AM

Previous topic - Next topic

DSV12

After upgrade roundcube from 1.5.3 -> 1.6.0 we got error with database connection:

DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: NO) in /xxx/roundcubemail/program/lib/Roundcube/rcube_db.php on line 200 (GET /webmail/)

All(?) necessary corrections have been made manually in config.inc.php:
renamed default_host to imap_host
renamed smtp_server to smtp_host


Environment:
# uname -r
4.18.0-372.16.1.0.1.el8_6.x86_64
# php -v
PHP 7.4.19 (cli) (built: May  4 2021 11:06:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies
# mysql --version
mysql  Ver 15.1 Distrib 10.3.32-MariaDB, for Linux (x86_64) using readline 5.1

# httpd -v
Server version: Apache/2.4.37 (Oracle Linux)
Server built:   Jun 22 2022 14:35:49


I noticed that in the roundcubemail/program/lib/Roundcube/rcube_db.php module, the lines related to the connection with the database have been changed, for example (left - 1.5.3, right - 1.6.0)

<             $username = isset($dsn['username']) ? $dsn['username'] : null;
<             $password = isset($dsn['password']) ? $dsn['password'] : null;
---
>             $username = $dsn['username'] ?? null;
>             $password = $dsn['password'] ?? null;


But as I see the syntax in the config.inc.php.sample did not changed:
$config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';

Why doesn't it work?

DSV12

SOLVED!

I think I found the cause of the problem - in config.inc.php password for to communicate with the database contain special characters (exclamation point in my my case), something like:

$config['db_dsnw'] = 'mysql://roundcube:Megapassw%21ord@localhost/roundcube';

When I changed '!' (%21) to a regular character (digit) - version 1.6.0 started working fine. Miracle :)