1 配置文件中my.cnf 的配置项msqld下面增加
skip-grant-tables
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‘