ubuntu中mysql重置root密码

xiaoxiao2021-02-28  67

时间长了,mysql的密码竟然忘了,不过这个难不倒哥

1、停止mysql服务:

service mysql stop

2、安全模式调过安全验证

2、不需要密码可以登录

mysql -p

3、修改root密码:

update user set authentication_string=password('jet123') where user='root'

4、正常模式启动:

service mysql restart

转载请注明原文地址: https://www.6miu.com/read-57035.html

最新回复(0)