- 執(zhí)行
mysql -u root -p
數(shù)據(jù)密碼颅夺,如果沒配置過全局變量則需進(jìn)入到Mysql的bin目錄里慨灭;
2.依次輸入:
(1)ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
(修改加密規(guī)則)
(2)ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
(更新用戶密碼 )
(3)FLUSH PRIVILEGES;
(刷新權(quán)限苦始,也可以不輸入)
3.重新連接礁鲁,大功告成粮彤。