误删mysql数据库密码后,如何恢复密码
生活随笔
收集整理的這篇文章主要介紹了
误删mysql数据库密码后,如何恢复密码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、停止mysql服務
net stop mysql2、修改mysql目錄下的my.ini文件,跳過mysql的登錄驗證
[mysqld] skip-grant-tables3、啟動mysql服務
net start mysql4、命令窗口登錄mysql(此時不用密碼也能登錄),新建用戶并授權
update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';flush privileges;grant all privileges on *.* to root@'localhost' identified by "123456";5、最后記得在配置文件中刪除 skip-grant-tables 參數,然后重啟MySQL服務。
總結
以上是生活随笔為你收集整理的误删mysql数据库密码后,如何恢复密码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 连接远程mysql遇到的问题及解决方法
- 下一篇: springboot项目中pom.xml