1:登陆
mysql -u root -p
2:查看密码信息
show VARIABLES like "%password%";
3:修改密码策略等级 默认是中等
set global validate_password_policy=0;
4:修改密码长度 默认是8
set global validate_password_length=4;
5:刷新权限
flush privileges;
6:设置新密码
select user, host from user;
alter user 'root'@'%' identified by '123456';
或者
alter user 'root'@'localhost' identified by '123456';
7:刷新
flush privileges;
8:退出
quit