Article ID: 123739, created on Dec 1, 2014, last review on Jun 17, 2016

  • Applies to:
  • Plesk for Linux/Unix
  • Plesk for Windows

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;
    

Search Words

ERROR: PleskFatalException: Unable to connect to database: mysql_connect(): mysqlnd cannot connect to MySQL

111555

old insecure authentication

apache

85a92ca67f2200d36506862eaa6ed6b8 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838

Email subscription for changes to this article
Save as PDF