1、打開my.cnf 加入 skip-grant-tables
2、mysql.service stop && mysql.service start
3、清空root密碼 并 退出
update mysql.user set authentication_string='' where user='root';
4、mysql.service stop && mysql.service start
5、mysql -root 免密登錄并修改root密碼
alter user 'root'@'%' identified by 'pass$123';
alter user 'root'@'localhost' identified by 'pass$123';
確定是否支持遠程登錄,host中有%的記錄即支持
2、mysql.service stop && mysql.service start
3、清空root密碼 并 退出
update mysql.user set authentication_string='' where user='root';
4、mysql.service stop && mysql.service start
5、mysql -root 免密登錄并修改root密碼
alter user 'root'@'%' identified by 'pass$123';
alter user 'root'@'localhost' identified by 'pass$123';
確定是否支持遠程登錄,host中有%的記錄即支持
select host, user, authentication_string, plugin from user;