Horde webmail error: "Could not instantiate PDO with DSN..."

Refers to:

  • Plesk 11.0 for Windows
  • Plesk 11.5 for Windows
  • Plesk 12.0 for Windows
  • Plesk 12.5 for Windows

Created:

2016-11-16 12:55:37 UTC

Modified:

2016-12-21 19:33:12 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Horde webmail error: "Could not instantiate PDO with DSN..."

Symptoms

When trying to access Horde webmail, either of the following errors is displayed:

A fatal error has occurred

Could not instantiate PDO with DSN "mysql:port=3306;protocol=tcp;host=127.0.0.1;dbname=horde". PDOException: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.

Details have been logged for the administrator.

or

A fatal error has occurred

Could not instantiate PDO with DSN "mysql:port=3306;protocol=tcp;host=127.0.0.1;dbname=horde". PDOException: SQLSTATE[HY000] [1045] Access denied for user 'horde'@'localhost' (using password: YES)

Details have been logged for the administrator.

Cause

  1. The MySQL service got removed as a result of a failed upgrade attempt

  2. The database user horde cannot access the Horde configuration database with the password saved in the configuration

Resolution

Case 1:

  1. Create a service using the Windows ' sc ' utility:

    sc create MySQL binPath= "%plesk_dir%\\Databases\\MySQL51\\bin\\mysqld.exe \\"--defaults-file=%plesk_dir%\\Databases\\MySQL\\Data\\my.ini\\" MySQL" start= auto
  2. Correct the MySQL configuration file and set the new ' basedir ' value. Replace:

    %plesk_dir%\\Databases\\MySQL\\Data

    With:

    %plesk_dir%\\Databases\\MySQL51
  3. Start the service from Windows' ' Services.msc ' snap-in, or from the command line:

    net start MySQL

Case 2:

  1. Restore horde database from backup location at %plesk_dir%\\MySQL\\Backup\\

  2. Get the password for the horde database user in the file %plesk_dir% \\Webmail\\horde\\conf\\.horde.shadow .

  3. Go to Tools & Settings > Database Servers > Local MySQL server > Webadmin .

  4. Switch to the SQL tab and enter the following requests, replacing <PASSWORD> with the password obtained in Step #1:

     UPDATE mysql.user SET password = PASSWORD("<PASSWORD>") WHERE user = 'horde';
    FLUSH PRIVILEGES;

    Then click the Go button.

Have more questions? Submit a request
Please sign in to leave a comment.