摘要: centos mysql忘记密码,修改密码 1.修改配置文件my.cnf [root@localhost ~]# vi /etc/my.cnf 找到mysqld在之后添加 skip-grant-tables 保存退出 2. 重启mysql服务(必须重启后才能不需要密码进入) systemctl restart mysqld 3.直接登陆mysql而不需要密码 mysql -u root (直接点击回车) 4.在mysql中输入 use mysql; update user set authentication_string='admin1234' where user='root'; 5.执行 flush privileges; 6.退出mysql ,到my.cnf中把开始添加的skip-grant-tables去掉 7.重启mysql服务 systemctl rstart mysqld 8.重新进入 mysql -u root -p 阅读全文
posted @ 2020-08-30 02:03 大自然的流风 阅读(2807) 评论(2) 推荐(1) 编辑