《Mysql必讀Linux Mysql root密碼忘記,初始化》要點:
本文介紹了Mysql必讀Linux Mysql root密碼忘記,初始化,希望對您有用。如果有疑問,可以聯系我們。
導讀:測試環境的mysql數據庫的root密碼找不到了,一個不重要的庫,安裝人員估計疏忽了...手動把密碼恢復了一下.記錄下來做個備注
測試環境的mysql數據庫的root密碼找不到了,一個不重要的庫,安裝人員估計疏忽了...手動把密碼恢復了一下.記錄下來做個備注
1、進入my.cnf ,在[mysqld]字段中添加?? skip-grant-tables
2、重啟mysql服務?? service mysqld restart
3、無密碼進入mysql修改密碼
mysql -uroot -p
mysql > update mysql.user set PASSWORD=password('new password') where user='root'
mysql>flush privileges
mysql>quit
4、刪除mysql.cnf中的 skip-grant-tables
5、重啟mysql服務
service mysqld restart
搞定!
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/5583.html