1、重置root密码
vi /etc/my.cnf
添加skip-grant-tables
service mysqld restart
2、mysql 登录
报错1
Unknown system variable 'validate_password_policy'
报错2
命令行无法输入命令提示 You must reset your password using ALTER USER statement before executing this statement.
报错3
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements。
3、解决办法:
首次设置一个复杂的密码 (mysql 默认是中级 MEDIUM) Root_12root
1\ use mysql
2\ update user set authentication_string = password("Root_12root") where user = 'root'
4\ 重启
5、用新密码登录,
6 、
alter user 'root'@'localhost' identified by 'Root_12root'
ALTER user 'root' IDENTIFIED BY '123456' ;