mysql5.7忘记root密码

systemctl stop mysqld.service
vi /etc/my.cnf
[mysqld]
skip-grant-tables
skip-networking

mysql -uroot -p  #直接回车

flush privileges

alter user root@localhost identified by 'newpassword';
相关文章
相关标签/搜索