msyql忘记密码
时间:2021-05-24 22:41:22
收藏:0
阅读:23
修改或找回root密码步骤
1.修改MySQL的登录设置: # vi /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 保存并且退出vi。 2.重新启动mysqld # /etc/init.d/mysqld restart ( service mysqld restart )
3 mysql -uroot -p 回车
USE mysql ;
update mysql.user set authentication_string=password(‘YpwgdKvMhrir3Tw2wvSI‘) where user=‘root‘;
或者
UPDATE user SET Password = password ( ‘new-password‘ ) WHERE User = ‘root‘ ;
flush privileges;
4、重启mysql
原文:https://www.cnblogs.com/y593216/p/14805119.html
评论(0)