[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:

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

View help

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

Still failed

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

The final solution

[root@localhostmysql]#vim/etc/my.cnf
[mysqld]
secure_auth=off

Then Restart Database
[root@localhost~]#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.

root@localhost11:31:[(none)]>

Update password format

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

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

Similar Posts: