RESOLUTION
SYMPTOMS
When you try to log into horde webmail you get an error
A fatal error has occurred
DB Error: connect failed
Details have been logged for the administrator.
CAUSE
Such error occurs when horde can not connect to database storage. In Plesk integration horde uses client mysql server. Exact reason why horde can not connect you can in horde log file C:\Windows\Temp\horde.log. But the basic reasons are listed below.
In C:\Windows\Temp\horde.log you can see error similar to:
1.
HORDE [emergency] [horde] DB Error: connect failed: [nativecode=Can't connect to MySQL server on 'localhost' (10061)] ** Array [on line 1259 of "C:\Inetpub\vhosts\webmail\horde\lib\Horde\DataTree\sql.php"]
It means MySQL server is down.
2.
HORDE [emergency] [horde] DB Error: connect failed: [nativecode=Unknown MySQL Server Host 'servername' (11004)] ** Array [on line 1259 of "C:\Inetpub\vhosts\webmail\horde\lib\Horde\DataTree\sql.php"]
Server 'servername' is invalid or does not exist.
3.
HORDE [emergency] [horde] DB Error: connect failed: [nativecode=Access denied for user 'horde'@'localhost' (using password: YES)] ** Array [on line 1259 of "C:\Inetpub\vhosts\webmail\horde\lib\Horde\DataTree\sql.php"]
Credentials for MySQL server are incorrect.
4.
HORDE [emergency] [horde] DB Error: no such database: [nativecode=Unknown database 'horde'] ** Array [on line 1259 of "C:\Inetpub\vhosts\webmail\horde\lib\Horde\DataTree\sql.php"]
Horde database does not exist.
RESOLUTION
You need to take a look into horde configuration file %plesk_vhosts%webmail\horde\config\conf.php
Find $conf['sql'] section. Check the following variables:
$conf['sql']['phptype'] – type of SQL server
$conf['sql']['port'] – port for connection
$conf['sql']['protocol'] – protocol for connection
$conf['sql']['hostspec'] – SQL server IP address or FQDN
$conf['sql']['username'] – SQL user for horde authentication
$conf['sql']['password'] – SQL user password
$conf['sql']['database'] – horde database in SQL server
Example of $conf['sql'] section.
$conf['sql']['phptype'] = 'mysql'; $conf['sql']['port'] = 3306; $conf['sql']['protocol'] = 'tcp'; $conf['sql']['hostspec'] = 'localhost'; $conf['sql']['username'] = 'horde'; $conf['sql']['password'] = 'webmail639'; $conf['sql']['database'] = 'horde'; |
1. Check MySQL server on $conf['sql']['hostspec']. It should be up and running.
2. Point correct server address to $conf['sql']['hostspec'].
3. You need to configure $conf['sql']['username'] and $conf['sql']['password'] in MySQL server. To do it you need to connect to $conf['sql']['hostspec']: $conf['sql']['port'] (e.g. localhost:3306) as SQL server administrator and perform the following queries:
mysql> REPLACE INTO `mysql`.`user` VALUES ('%','horde',password('password'),'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0); mysql> REPLACE INTO `mysql`.`tables_priv` VALUES ('%','horde','horde','horde_users','root@localhost','2006-07-19 12:15:26','Select,Insert,Update,Delete',''),('%','horde','horde','horde_prefs','root@localhost','2006-07-19 12:15:26','Select,Insert,Update,Delete',''),('%','horde','horde','horde_datatree','root@localhost','2006-07-19 12:15:26','Select,Insert,Update,Delete',''),('%','horde','horde','horde_datatree_attributes','root@localhost','2006-07-19 12:15:26','Select,Insert,Update,Delete',''),('%','horde','horde','horde_tokens','root@localhost','2006-07-19 12:15:26','Select,Insert,Update,Delete',''),('%','horde','horde','horde_vfs','root@localhost','2006-07-19 12:15:26','Select,Insert,Update,Delete',''),('%','horde','horde','turba_objects','root@localhost','2006-07-19 12:15:27','Select,Insert,Update,Delete',''); mysql> FLUSH PRIVILEGES; password should be equal $conf['sql']['password'] |
4. You need to recreate horde database. You can do it using attached file. Connect to MySQL server as SQL server administrator and call the zipped file.
ATTACHED FILES:
| horde.zip |