First of all, let me explain. The following description is limited to the Win system. I have not tried other systems. Mysql has changed the format of user passwords since 4.1.1, increasing it from 16 to 41 digits and adopting a new verification method. But before 4.1 The client protocol does not support this method, so it results in the inability to log in. Even if the password is correct and you cannot log in normally, the prompt is as follows:
#1250 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
Execute in window:
C:mysql in>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version : 5.0.0-alpha-nt
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> select password('aa') ;
+------------------------------------------------+
| password('aa') |
+------------------------------------------------ -------+
| *DEE59C300700AF9B586F9F2A702231C0AC373A13 |
+-------------------------------- ------------+
1 row in set (0.00 sec)
mysql>
It can be seen from the above that the password result returns a '*' A 41-digit string starting with the number, which used to be 16 digits.
The official Mysql website gives two solutions
1. Use the new client api,
2 , force the server to use the old password scheme
I first tried the first method, copying libmysql.dll from mysql5.0 to the extension directory of php, replacing the libmysql.dll that comes with php itself, but The results are disappointing. Php prompts that loading php_mysql.dll failed: PHP Warning: PHP Startup: Unable to load dynamic library 'c:/php5/ext/php_mysql.dll' - The specified program cannot be found. Later, I found that the mysql_drop_db() function was missing in the new version of the dll:( I have to wait for php or mysql to release an updated dll.
The first method does not work, so I have to try the second method, mysql The official FAQ says that you need to add the -old-password parameter. I first tried to start mysql from the command line,
c:mysql in>mysqld-nt -old-password
In another Run in one window
C:mysql in>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 540 to server version: 5.0.0-alpha -nt