Hi, I recently downloaded roundcube (CVS-20051216 version) and had some problems with installation. After a few hours of debugging, I found the problem and just wanted to give people a heads-up regarding this issue as i'm sure it's going to bite a few others :)
My set up: Apache 1.3.34 PHP 4.4.1 MySQL 4.1.16
The problem I was experiencing was that every time I attempted to load roundcube I was getting the following errors: DB Error in /path/to/roundcube/program/include/rcube_db.inc (67): DB Error: connect failed Fatal error: Call to undefined function: query() in /path/to/roundcube/program/include/rcube_db.inc on line 151
After several hours of profanity thinking that i'd buggered up the DSN specification, I enabled MySQL's logging to see what exactly was being sent to the server from roundcube and why the connection was being refused. I discovered that this problem has _nothing_ to do with roundcube but is due to the interaction between newer versions of MySQL and PHP.
Since MySQL version 4.1.1 there has been a new hashing algorithm used to store database user passwords in MySQL. Unfortunately, the version of DB in roundcube (and the current version in PEAR) do not have the capability to send database user passwords in the new hashed format. The mysqli extension in PHP5 (apparently) doesn't suffer this problem.
The MySQL manual details several ways to correct this issue, but the least intrusive seems to be to "degrade" the password for just the roundcube database user to the old style hashing format, which PHP can use to authenticate. Of course, this can be done for any other databases which need to be accessed from PHP when used with MySQL => 4.1.1.
The full details of the other options are available in the manual, but the quick fix is: # mysql -u root -p mysql Enter password: <blah> mysql> SET PASSWORD FOR 'roundcube'@'localhost' = OLD_PASSWORD('new_password'); mysql> quit
You'll (obviously) need to change the details for the roundcube user to the user for your database and set "new_password" to a, well, new password :)
The above should be done after the MySQL table set up as detailed in the INSTALL file.
Once the password "degrade" is done, roundcube should connect without problems.
I hope this info helps stop someone else spending a couple of hours trying to figure out the problem!
Anyway, great work on the application guys.. kicks squirrelmail in the balls for look and feel :)
Cheers, Darren.
On Thursday 22 December 2005 09:44, Darren Austin wrote:
Since MySQL version 4.1.1 there has been a new hashing algorithm used to store database user passwords in MySQL. Unfortunately, the version of DB in roundcube (and the current version in PEAR) do not have the capability to send database user passwords in the new hashed format. The mysqli extension in PHP5 (apparently) doesn't suffer this problem.
The MySQL manual details several ways to correct this issue, but the least intrusive seems to be to "degrade" the password for just the roundcube database user to the old style hashing format, which PHP can use to authenticate. Of course, this can be done for any other databases which need to be accessed from PHP when used with MySQL => 4.1.1.
The full details of the other options are available in the manual, but the quick fix is: # mysql -u root -p mysql Enter password: <blah> mysql> SET PASSWORD FOR 'roundcube'@'localhost' = OLD_PASSWORD('new_password'); mysql> quit
The way around this that I've used (and my preferred method) is to compile a
version of php_mysql that is linked against libmysql14 instead of the older
libmysql12, thus when it connects, it will used the new password algorithm.
The solution works great, and you get to keep the greater security of a more
secure hash.
j----- k-----