"Cannot connect to MySQL 4.1+ using the old insecure authentication" error in Plesk

Refers to:

  • Plesk for Windows
  • Plesk for Linux

Created:

2016-11-16 13:22:33 UTC

Modified:

2016-12-21 20:34:43 UTC

0

Was this article helpful?


Have more questions?

Submit a request

"Cannot connect to MySQL 4.1+ using the old insecure authentication" error in Plesk

Symptoms

In Parallels Plesk the following error occurs:

Error:  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_password'). 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

Old passwords hash scheme is used.

To verify that log in to MySQL and issue the following query:

mysql> SHOW VARIABLES LIKE 'old_passwords'
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| old_passwords | ON |
+---------------+-------+

Resolution

  1. Set ' old-passwords ' value to 0 in /etc/my.cnf on Linux and in C:\\Program Files (x86)\\Parallels\\Plesk\\MySQL\\Data\\my.ini on Windows.

    Restart mysql service.

    On Linux

    # service mysqld restart

    On Windows

    C:\\Program Files (x86)\\Parallels\\Plesk\\> net stop PleskSQLServer
    C:\\Program Files (x86)\\Parallels\\Plesk\\> net start PleskSQLServer
  2. List mysql users with passwords that are 16 symbols long:

    mysql> SELECT `User`, `Host`, Length(`Password`) FROM mysql.user where Length(`Password`)=16;
    +------------------+-----------+--------------------+
    | User | Host | Length(`Password`) |
    +------------------+-----------+--------------------+
    | db_user | localhost | 16 |
    +------------------+-----------+--------------------+

    Update such passwords:

    mysql> UPDATE mysql.user SET Password = PASSWORD('plain_password') WHERE user = 'db_user';
    mysql> FLUSH PRIVILEGES;
Have more questions? Submit a request
Please sign in to leave a comment.