No solution to the problem after mysql5 change code

xiaoxiao2021-03-06  90

First explain, the following description is limited to the Win system other system, I have not tried it.

MySQL modified users since 4.1.1

The format of the password, increased from 16 bits to 41 bits, using a new verification method,

But 4.1 The previous client protocol does not support this method, so it has caused the consequences that cannot be registered.

even if

The password correctly does not log in normally, prompts as follows

# 1250 - Client Does Not Support Authentication Protocol Requested by Server; Consider Upgrading MySQL Client

Execute in the 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>

From now on, the result of Password returns a 41-bit string starting with '*', and it is 16-bit.

The official website of MySQL gives two solutions

1. Use the new client API,

2, forced server uses old

Cryptographic program

I first tried the first method, from

Mysql5.0 copy libmysql.dll to the PHP extension directory, replacing the libmysql.dll included with the PHP itself, but the result is disappointing. PHP prompts to load php_mysql.dll failed:

PHP WARNING: PHP Startup: Unable to load Dynamic library 'c: / php5/ext/php_mysql.dll' - The specified program is not found.

Later, I found a function of mysql_drop_db () in the new version of the DLL: (only the other PHP or MySQL updated DLL.

The first method is not good, only the second method, Mysql's official FAQ said, need to add -Old-password this parameter,

I first tried to start mysql at 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.

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 results of Password become 16-bit, gratifying,

,

Some of the fossils ..........]

I am in c: / windows/my.ini (XP, 98, in this, in 2000 should be added "set-variable = old-passwords" in the "mysqld" segment in C: / WINT / below.

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 is normal,

Later, I found that as long as I change the length of Password in the mysql.user table to 16 systems, it automatically switched to the Oldpassword mode, and changed to another back to 41 and automatically changed to a new verification method.

Remind it here, change the password method, to reset it

Password and refresh the permissions (or restart mysql)

转载请注明原文地址:https://www.9cbs.com/read-106686.html

New Post(0)