Author Topic: Roundcube not working after moving mysql database directory  (Read 3096 times)

Offline pinemail11

  • Jr. Member
  • **
  • Posts: 16
Hello Team,

We are using Roundcubemail 0.3.1 with Mysql as backend on our mail server.
We have changed mysql database directory from the default /var/lib/mysql to /var/vmail/mysql.
After giving proper permission and changing the configuration on my.cnf file, mysql is working fine. Made following changes on my.cnf
datadir=/var/vmail/mysql
socket=/var/vmail/mysql/mysql.sock
basedir=/var/vmail
When we use roundcube, we get the following error.
DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!
Please contact your server-administrator

Roundcube error log shows the following errors.

[01-Jul-2010 11:06:11] MDB2 Error: unknown error (-1): _doConnect: [Error message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]
[Native code: 2002]
[Native message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]

Could someone please help me making roundcube to look at the new directory?

Offline pinemail11

  • Jr. Member
  • **
  • Posts: 16
Roundcube not working after moving mysql database directory
« Reply #1 on: July 02, 2010, 04:08:16 AM »
ok..got the solution from someone.

Replace "localhost" with "127.0.0.1" from the following line in db.inc.php.

$rcmail_config['db_dsnw'] = "mysqli://roundcube:passwd@localhost/roundcubemail";

If it's 'localhost', all connections will try to use a unix local socket instead of TCP/IP connection.
Hope this will be useful for someone.