[Solved] Error report of inconsistent password format between low version and high version of MySQL

When importing low version database data into high version database, the following problems are caused by different password formats:

[[email protected]~]#mysql-uroot-p
Enterpassword:
ERROR2049(HY000):Connectionusingold(pre-4.1.1)authenticationprotocolrefused(clientoption'secure_auth'enabled)

View help

[[email protected]]#mysql--help|grep'secure-auth'
--secure-authRefuseclientconnectingtoserverifitusesold
(Defaultstoon;use--skip-secure-authtodisable.)

Still failed

[[email protected]~]#mysql-uroot-p--secure-auth=off
Enterpassword:
ERROR1275(HY000):Serverisrunningin--secure-authmode,but'root'@'localhost'hasapasswordintheoldformat;pleasechangethepasswordtothenewformat。

The final solution

[[email protected]]#vim/etc/my.cnf
[mysqld]
secure_auth=off

Then Restart Database
[[email protected]~]#mysql-uroot-p--secure-auth=off
Enterpassword:
WelcometotheMySQLmonitor.Commandsendwith;or\g.
YourMySQLconnectionidis5
Serverversion:5.6.28-76.1-logPerconaServer(GPL),Release76.1,Revision5759e76

Copyright(c)2009-2015PerconaLLCand/oritsaffiliates
Copyright(c)2000,2015,Oracleand/oritsaffiliates.Allrightsreserved.

OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.

Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.

[email protected]:31:[(none)]>

Update password format

[email protected]:31:[(none)]>updatemysql.usersetpassword=password('xxxxxx')whereuser='root'andhost='localhost';
[email protected]:36:[(none)]>flushprivileges;

Delete secure after modification_ Auth = off parameter, restart the database

Similar Posts: