centos mysql8修改密码,忘记密码

1.越权:

mysqld --user=mysql --skip-grant-tables --skip-networking &

2.刷新权限

mysql> GRANT ALL ON *.* TO 'gongzheng'@'%';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)

3.完成后杀掉mysqld,再重启 mysql

猜你喜欢

转载自blog.csdn.net/m0_37574375/article/details/108514269