ubuntu中mysql忘记密码如何修改

1.在终端进入安装目录下:cd /etc/mysql

2.sudo cat debian.cnf 输入密码

3用如下图用户和密码登录

4.进入mysql use mysql

5.使用describe user;查询下图就是密码字段

6.修改密码

update mysql.user set authentication_string=password('密码') where user='root';

7.退出exit

8.重新启动service mysql

猜你喜欢

转载自www.cnblogs.com/tataerzu/p/10345487.html