1

Topic: DATABASE ERROR: CONNECTION FAILED! help.

Hi, I receive the above error (DATABASE ERROR: CONNECTION FAILED!) after I change the server name, I'm using iredmail 0.8.5 for mysql in ubuntu 12.04. I will appreciate any advice.

----

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

2

Re: DATABASE ERROR: CONNECTION FAILED! help.

Check your webmail configure file (/usr/share/apache2/roundcubemail/config/db.inc.php), make sure you have correct SQL server address, username, password.

3

Re: DATABASE ERROR: CONNECTION FAILED! help.

Thanks ZhangHuangbin I open "/usr/share/apache2/roundcubemail/config/db.inc.php" and the only variable I found that could be useful is "$rcmail_config['db_dsnw'] = "mysqli://" I change it to "$rcmail_config['db_dsnw'] = "mysqli:roundcube:VUzgoomtJBhwAxxxxxxMvOP3KiC@127.0.0.1/roundcubemail";" and create the user roundcube with password VU*iC  in mysql, but still not working.

4

Re: DATABASE ERROR: CONNECTION FAILED! help.

Please make sure you can connect to SQL database with this SQL username/password. Also, check its log file (it logs to Postfix log file) to see whether there's any related log.

5

Re: DATABASE ERROR: CONNECTION FAILED! help.

I check the user roundcube with the password I assigned to it and it seams to work.
I have a series if warnings in /var/log/mail.warn similar to:

Apr  2 19:15:40 server2 postfix/pickup[27724]: warning: 9186B39E014F: message has been queued for 79 days
Apr  2 19:15:40 server2 postfix/cleanup[28174]: warning: proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf lookup error for "root@{mysite.com}"
Apr  2 19:15:40 server2 postfix/cleanup[28174]: warning: 9186B39E014F: sender_bcc_maps lookup problem
Apr  2 19:15:40 server2 postfix/pickup[27724]: warning: maildrop/EEF5B39E489C: error writing 9186B39E014F: queue file write error

After checking the log I opened the file "/etc/postfix/mysql/sender_bcc_maps_user.cf" it had a username and password not recognize by the mysql, the username is "vmail" I created the user and tested manually, the warnings seem to stop, but the mail still not working. I want to point out that it used to work, the story goes like this I installed iremail in a fresh server with one domain, I tested and it work just perfect, the I added more domains and tested and work just fine, then I added a last domain which had conflict with my server name and even then the mail seems to work, finally I change the server name and since the mail stop working. the conflict was that the server name was the same a one domain and the server was redirecting all domains to the one of the server name.

6

Re: DATABASE ERROR: CONNECTION FAILED! help.

Now I just check "/var/log/mail.err" it has logs similar to :

Apr  3 00:42:33 server2 roundcube: DB Error: [1046] No database selected (SQL Query: SELECT vars, ip, changed FROM session WHERE sess_id = 'h046j0tdnpkfubg04ko609h7r7') in /usr/share/apache2/roundcubemail-0.9.2/program/lib/Roundcube/rcube_db.php on line 416 (GET /mail/)
Apr  3 00:42:33 server2 roundcube: DB Error: [1046] No database selected (GET /mail/)
Apr  3 00:42:33 server2 roundcube: DB Error: [1046] No database selected (SQL Query: INSERT INTO session (sess_id, vars, ip, created, changed) VALUES ('h046j0tdnpkfubg04ko609h7r7', 'dGVtcHxiOjE7bGFuZ3VhZ2V8czo1OiJlbl9VUyI7dGFza3xzOjU6ImxvZ2luIjs=', '187.209.7.87', '2014-04-02 20:42:33', '2014-04-02 20:42:33')) in /usr/share/apache2/roundcubemail-0.9.2/program/lib/Roundcube/rcube_db.php on line 416 (GET /mail/)

it looks like its trying to access a DB not found by roundcube, I give temporary access to all my DB to roundcube, yet the problem persist.

7

Re: DATABASE ERROR: CONNECTION FAILED! help.

tanatos84 wrote:

I change it to "$rcmail_config['db_dsnw'] = "mysqli:roundcube:VUzgoomtJBhwAxxxxxxMvOP3KiC@127.0.0.1/roundcubemail";"

It should be "mysqli://", you missed '//' here.

Please make sure you have correct SQL username/password in config files.

8

Re: DATABASE ERROR: CONNECTION FAILED! help.

I undo the change I made in db.inc.php as you suggested a it work almost perfect, It allow me to login, read old mails, and send mails, but it doesn't receive mails, perhaps is a temporary delay or a dns problem, but if you have an advice on how can I troubleshot my final problem it will help me a lot.