mysql忘記密碼時如何修改

1.先關閉mysql服務,打開cmd進入mysql下的bin文件夾mysql

 

2.輸入命令 mysqld --skip-grant-tables (在輸入此命令前關閉mysql進程)sql

3.登陸mysql數據庫

4.show databses 查看數據庫進程

5.找到mysql數據庫查看mysql數據庫此時你會發現一個user表,user表存放的就是數據庫帳號信息ip

6.select user,host,password from user 查看帳號信息cmd

7.更改密碼 update user set password=password('123123') where user='root' and host='localhost';table

8.退出cmd 重啓mysql用新密碼登陸登錄

相關文章
相關標籤/搜索