更新时间:2022-09-17 17:19:44
在Gnu/Linux下忘记了MySQL的密码了,怎么找回呢?只需要经过以下简单的步骤,即可找回,
1
2
3
4
5
6
7
8
|
[root@localhost ~] # service mysqld stop
[root@localhost ~] # killall -TERM mysqld
[root@localhost ~] # mysqld_safe --skip-grant-tables &
[root@localhost ~] # mysql
mysql> use mysql; mysql> update user set password( 'new_pass' ) where user= "root" ;
mysql> exit
[root@localhost ~] # service mysqld restart
|