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';
相關文章
相關標籤/搜索