共計 761 個字符,預計需要花費 2 分鐘才能閱讀完成。
本篇內容主要講解“MySQL 忘記 root 密碼的修改方法”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓丸趣 TV 小編來帶大家學習“MySQL 忘記 root 密碼的修改方法”吧!
方法一:
# /etc/init.d/mysql stop
# mysqld_safe –user=mysql –skip-grant-tables –skip-networking
# mysql -u root 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
登陸后再 set 下密碼
mysql set password=password(root
方法二:
直接使用 /etc/mysql/debian.cnf 文件中 [client] 節提供的用戶名和密碼:
# mysql -udebian-sys-maint -p
Enter password: 輸入 [client] 節的密碼
mysql UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql FLUSH PRIVILEGES;
mysql quit
# mysql -uroot -p
Enter password: 輸入新設的密碼 newpassword
到此,相信大家對“MySQL 忘記 root 密碼的修改方法”有了更深的了解,不妨來實際操作一番吧!這里是丸趣 TV 網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!