Mysqlnd is a good thing. Not only can improve the efficiency of communication with MySQL database, but also can easily set some timeouts. For example, the connection timed out and the query timed out.
However, when using MYSQLND, there is a place to pay attention to. Is that the service-side password format does not use the old 16-bit storage format, but rather the new 41-bit storage format.
If the service-side password format is 16 bits, the error will be correct. The information is as follows:
Fatal error:uncaught exception ' pdoexception ' with message ' sqlstate[hy000] [Watts] MYSQLND cannot connect to MySQL 4.1+ u Sing the old insecure authentication. Please use a administration tool to reset your password with the command SET password = password (' Your_existing_password ' ). This would 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 ' In/home/hailong.xhl/test.php:8
How to see if your password meets your requirements.
mysql> Select User,length (password) from Mysql.user;
+--------------+------------------+
| user | Length (password) |
+--------------+------------------+
| Demo | 16 |
| Demo | 16 |
+--------------+------------------+
The password above is the old 16-bit format. If you want to change to a new 41-bit format, you can use the following command.
Mysql>update mysql.user SET Password = Password (' demo ') WHERE user = ' demo ';
Query OK, 2 rows Affected (0.00 sec)
Rows matched:2 Changed:2 warnings:0
mysql> Select User,length (password) from Mysql.user;
+--------------+------------------+
| user | Length (password) |
+--------------+------------------+
| Demo | 41 |
| Demo | 41 |
+--------------+------------------+
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
After you have modified your password, you will also need to modify the Old_passwords option in the configuration file. Set the value to 0. That
Old_passwords=0
Then restart MySQL.