mysql 8.0.21修改root密码

1 配置文件中my.cnf 的配置项msqld下面增加

  skip-grant-tables

mysql 8.0.21修改root密码

 

2 mysql -u root 登进去

 切换mysql数据库

  use mysq   

密码置空

UPDATE user SET authentication_string = ‘‘ WHERE User = ‘root‘;

退出后重启mysql服务 

登陆

mysql -u root -p

回车

设置弱口令

set global validate_password.policy=0; 

ALTER user ‘root‘@‘localhost‘ identified by ‘simplepass‘;

flush privileges;

ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘?

https://*.com/questions/5555328/error-1396-hy000-operation-create-user-failed-for-jacklocalhost

drop user admin@localhost;
flush privileges;
create user admin@localhost identified by ‘admins_password

 

mysql 8.0.21修改root密码

上一篇:java 判断两个时间相差的天数


下一篇:03 MySQL基础(三)