Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to answer the problem that mysql5 cannot log in after changing its password

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to answer the problem that mysql5 cannot log in after changing your password. The content is concise and easy to understand, and it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

First of all, I have not tried the following description only in other systems of the Win system. Mysql has changed the format of the user's password from 16 bits to 41 bits since 4.1.1, and adopted a new authentication method, but the previous client protocol did not support this method, so it caused the consequence that it could not be logged in. Even if the password is correct and 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 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 (aa)

+-- +

| | password (aa) |

+-- +

| | * DEE59C300700AF9B586F9F2A702231C0AC373A13 |

+-- +

1 row in set (0.00 sec)

Mysql >

You can see from the above that the result of password returns a 41-bit string that begins with a * sign, compared with the previous 16-bit string.

The official Mysql website offers 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 to replace the libmysql.dll that came with php itself, but the result was disappointing. Php prompt failed to load php_mysql.dll: PHP Warning: PHP Startup: Unable to load dynamic library c:/php5/ext/php_mysql.dll-the specified program could not be found. Later, it was found that the function mysql_drop_db () was missing in the new version of dll and had to wait for php or mysql to produce an updated dll.

The first method does not work, only try the second method, mysql's official FAQ said, need to add-old-password this parameter, I first try to start mysql at 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 >

You can see that the result of password has become 16-bit again, a gratifying change.

I added "set-variable=old-passwords" to the "d" paragraph in c:my.ini (xp,98, as such, 2000 should be under 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

Then start mysql in the service manager

Very Good, everything's fine.

Later, I found that as long as the field length of password was changed to 16 in the mysql.user table, the system automatically switched to oldpassword mode, changed back to 41, and then automatically changed to the new verification mode.

As a reminder here, after changing the password mode, reset the password and refresh the permissions (or restart mysql).

The above content is how to answer the problem that mysql5 cannot log in after changing its password. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report