Unable to install Horde webmail: PDOException: SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication

Created:

2016-11-16 13:16:56 UTC

Modified:

2017-04-24 11:40:40 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to install Horde webmail: PDOException: SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication

Applicable to:

  • Plesk 11.5 for Linux

Symptoms

An attempt to install Horde webmail via /usr/local/psa/admin/sbin/autoinstaller fails with the following error:

Fatal Error:
Could not instantiate PDO with DSN "mysql:protocol=unix;unix_socket=/var/lib/mysql/mysql.sock;dbname=horde". PDOException: SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_pass word'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file

Cause

MySQL server was configured with “ old_passwords ” set to On , which sets password operations to use the older 16 hexadecimal digits (64 bit) hashing of your passwords. With so called "new passwords" you get 40 hexadecimal digits (plus extra "*"). Read more on the manual .

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"SHOW VARIABLES LIKE 'old_passwords'"
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| old_passwords | ON |
+---------------+-------+
1 row in set (0.00 sec)

# grep old_passwords /etc/my.cnf
old_passwords=1

Resolution

  1. Create database backups:

    # mkdir /root/mysql_backups/
    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ne"show databases"|grep -v information_schema|while read db;do MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin $db > /root/mysql_backups/$db.sql;done
  2. Put a comment on the " old_passwords=1 " entry in the my.cnf configuration file (put the hash symbol (#) on the beggining of the string).

    grep old_passwords  /etc/mysql/my.cnf
    #old_passwords=1

    OR

    set the " old_passwords " entry in the my.cnf configuration file to zero(0)

    grep old_passwords  /etc/mysql/my.cnf
    old_passwords=0
  3. Restart MySQL service:

    # service mysqld restart
  4. Run /usr/local/psa/admin/sbin/autoinstaller to install Horde webmail

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