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';

  

posted on 2017-08-18 09:19  jenqz  阅读(160)  评论(0)    收藏  举报