mysql8修改密码策略

由于上面给的文件中连接数据库的密码是root
所以得改密码,找了好多都不行,所以:

查看当前密码策略
SHOW VARIABLES LIKE ‘validate_password%’;
mysql8修改密码策略_第1张图片
一起复制粘贴到mysql命令行:
alter user user() identified by “root”;
set global validate_password.policy=0;
set global validate_password.length=4;
set global validate_password.check_user_name=OFF;
set global validate_password.number_count=0;
set global validate_password.special_char_count=0;
flush privileges;
ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘root’ ;
update user set host=’%’ where user =‘root’;

密码就改成root了

你可能感兴趣的:(mysql8修改密码策略)