linux下忘記mysql root密碼的解決方案

今天我們主要是講一下關於linux忘記mysql密碼處理方法,下面提供了5種linux忘記mysql密碼找回方法哦。
方法一(先進入root權限):

/etc/init.d/mysql stop

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

mysql -u root

mysql>use mysql
mysql> update user set password=password(“newpassword”) where user=‘root’;
mysql> flush privileges;
mysql> quit

/etc/init.d/mysql restart

mysql -uroot -p

enter password: <輸入新設的密碼newpassword>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章