MySQL5 password can not log on after the answer to the question

Source: Internet
Author: User
Tags command line end log mysql mysql client version window client

First of all, the following description is limited to the win system other systems I have not tried, Mysql since 4.1.1 modified the user password format, from 16 bits to 41 bits, a new authentication method, but 4.1 of the previous client protocol does not support this method, So it caused the consequences of not boarding. You cannot log on correctly even if the password is correct.

The prompts are as follows:

#1250-client does not support authentication protocol requested by server; Consider upgrading MySQL client

To execute in a window:

C:\mysql\bin>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 result of password returns a 41-bit string that begins with a ' * ' number, which was previously 16-bit.

MySQL official website gives two kinds of solutions

1, using the new client API,

2, forcing the server to use the old password scheme

I first tried the first approach, copying Libmysql.dll from mysql5.0 to PHP's extended directory, instead of the libmysql.dll that came with PHP itself, but the result was disappointing. PHP Prompts Mount Php_mysql.dll failed: Php warning:php startup:unable to load Dynamic Library ' C:/php5/ext/php_mysql.dll '-the specified program was not found. It was later discovered that the mysql_drop_db () function was missing from the new version of the DLL:( Only wait for PHP or MySQL out of the updated DLL.

The first method doesn't work, only try the second approach, the MySQL official FAQ says, "You need to add the-old-password parameter, I first try to start MySQL under the command line,"

C:\mysql\bin>mysqld-nt-old-password

Run in another window

C:\mysql\bin>mysql-uroot

Welcome to the MySQL Monitor. Commands End With; or \g.

1 2 Next page > full text reading tips: Try "←→" button, turn the page more convenient Oh!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.