900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > centos 下重置mysql密码

centos 下重置mysql密码

时间:2020-04-17 17:37:28

相关推荐

centos 下重置mysql密码

1.修改配置文件

1.修改配置文件

--- vim /etc/f

在 [mysqld] 的段中加上一句:skip-grant-tables

2.重启mysql

--- systemctl restart mysqld

3.修改密码

--- use mysql;

--- update user set authentication_string=password('new password') where user = 'root';

退出,再次进入

4.设置密码

--- use mysql;

--- set global validate_password_policy=0;

--- set global validate_password_length=1;

--- alter user 'root'@'localhost' identified by 'new password';

退出,

5.还原配置文件

--- vim /etc/f

注释掉原本的:skip-grant-tables

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。