I just installed the RoundCube php mail client. I check the MySQL database and the new table was created, but through browser I'm getting the following error:
DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!
Please contact your server-administrator.
I check the debian-db.php and the login parameters are correct, I also tried through terminal and I can connect to the db using this parameter
$dbuser='roundcube';
$dbpass='mypass';
$basepath='';
$dbname='roundcube';
$dbserver='';
$dbport='';
$dbtype='mysql';
It seemingly being an Ubuntu system you can also install the driver directly using apt-get.
(The package has been a part of Ubuntu since 10.04.)
1) Enable mysql logging and see whether it is generating any relavent info.
2) Make sure that sql safe mode is not enabled in php
3) Enable sql trace mode in php.ini and see whether it is generating any additional debug info which might be useful.
Database connection errors happens when the followings happens:
config/db.inc.php
)To solve the first problem, you need to configure the following parameter correctly
{db_provider}
is database agent such as mysql, mysqli, sqlite etc{username}
is your username to the database{password}
is your password to the database{host}
is either localhost or some host parameter for the location of your database server{database}
is your database name, by default it is roundcubemailExample:
To solve the second problem, you need to run the installer to verify your system. Please remove
installer/
folder once you have done the installation.To run the test: go to
{roundcube_domain}/installer/index.php
.And you will see all the requirements needed to run roundcube. Follow the instruction, you will be running roundcube in no time.
I've just had this error and the change from localhost to 127.0.0.1 fixed it for me!
mysql://roundcube:[email protected]/roundcubemail is now working
Maybe set
$dbserver='';
to$dbserver='localhost';
instead of leaving it blank.I my case, it could not resolve
localhost
, hence simply changing it to127.0.0.1
fixed the issue. (I am usingMountain Lion
.)I had the same issue. This may help someone. Mine was installed using webmin
go to roundcube install location. usually it's like
/home/domain/public_html/roundcube
open
config.inc.php
in/home/domain/public_html/roundcube/config
find the line like
either change password here or change the password for user name
mysqluser