1

Topic: Roundcube stopped after moving mysql database to different directory

Hello Team,

We are using Roundcubemail 0.3.1 with Mysql as backend on our iRedMail 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?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Roundcube stopped after moving mysql database to different directory

You can try to modify roundcube config: config/db.inc.php, change mysql connection setting. Use '127.0.0.1' instead of 'localhost'

If it's 'localhost', all connections will try to use a unix local socket instead of TCP/IP connection.

3

Re: Roundcube stopped after moving mysql database to different directory

Thanks Zhang for the reply. Following are the settings in db.inc.php. Should I add an extra line? or which line should I modify?
Sorry I am very poor in this.

$rcmail_config = array();
$rcmail_config['db_dsnw'] = "mysqli://roundcube:passwd@localhost/roundcubemail";
$rcmail_config['db_dsnr'] = '';
$rcmail_config['db_max_length'] = 512000;  // 500K
$rcmail_config['db_persistent'] = FALSE;
$rcmail_config['db_table_users'] = 'users';
$rcmail_config['db_table_identities'] = 'identities';
$rcmail_config['db_table_contacts'] = 'contacts';
$rcmail_config['db_table_session'] = 'session';
$rcmail_config['db_table_cache'] = 'cache';
$rcmail_config['db_table_messages'] = 'messages';
$rcmail_config['db_sequence_users'] = 'user_ids';
$rcmail_config['db_sequence_identities'] = 'identity_ids';
$rcmail_config['db_sequence_contacts'] = 'contact_ids';
$rcmail_config['db_sequence_cache'] = 'cache_ids';
$rcmail_config['db_sequence_messages'] = 'message_ids';

4

Re: Roundcube stopped after moving mysql database to different directory

Replace 'localhost' by '127.0.0.1' in this line:

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

5

Re: Roundcube stopped after moving mysql database to different directory

WARNING: DO NOT post/show any password publicly.

6

Re: Roundcube stopped after moving mysql database to different directory

Thanks...I will try this.
In fact I have changed the password smile

7

Re: Roundcube stopped after moving mysql database to different directory

That worked.
thanks very much Zhang smile