After changing the password of MySQL5, you cannot log on to the system. the following description is only available in other Windows systems. I have not tried it. Mysql has changed the format of the user password since 4.1.1, A new verification method has been adopted since 16 bits to 41 bits. However, the client protocols earlier than 4.1 do not support this method, so it has the consequence that it cannot be reached. even if the password is correct and cannot be properly logged on, the prompt is as follows:
#1250-Client does not support authentication protocol requested by server; consider upgrading MySQL client
Run the following command in the window:
C: mysqlin> 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 ('A ');
+ ------------------------------------------- +
| Password ('A') |
+ ------------------------------------------- +
| * DEE59C300700AF9B586F9F2A702231C0AC373A13 |
+ ------------------------------------------- +
1 row in set (0.00 sec)
Mysql>
From the above, we can see that the password result returns a 41-bit string starting with '*', which is 16 bits in the past.
The official Mysql website provides two solutions
1. use the new client api,
2. force the server to use the old password
First, I tried the first method to copy libmysql from mysql5.0. dll to the extension directory of php, replacing libmysql with php itself. dll, but the results are disappointing. php prompts that php_mysql.dll loading 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 new dll version lacks the mysql_drop_db () function: (only when php or mysql releases the updated dll.
The first method does not work. you only need to try the second method. the mysql official FAQ says that you need to add the-old-password parameter. first, I try to start mysql under the command line,
C: mysqlin> mysqld-nt-old-password
Run in another window
C: mysqlin> 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
Type 'help; 'or 'H' for help. Type 'C' to clear the buffer.
Mysql> select password ('mypassword ');
+ ------------------------ +
| Password ('mypassword') |
+ ------------------------ +
| 162eebfb6477e5d3 |
+ ------------------------ +
1 row in set (0.55 sec)
Mysql>
It can be seen that the password result is changed to 16 bits, and the change is gratifying.
In c: windowsmy. ini (xp, 98, 2000, add "set-variable = old-passwords" to the "mysqld" section in c: wint"
Example:
[Mysqld]
Basedir = C:/mysql
Set-variable = old-passwords
Datadir = C:/mysql/data
[WinMySQLadmin]
Server = C:/mysql/bin/mysqld-nt.exe
User = root
Password = mypassword
Start mysql in Service Manager
Later, I found that. in the user table, if the length of the password field is changed to 16, the system automatically switches to the oldpassword mode. after the password field is changed to 41, the system automatically switches to the new authentication mode. after changing the password method, you need to reset the password and refresh the permission (or restart mysql)