首页 > 数据库技术 > 详细

centos 7 + mysql 5.7.13 重置数据库的root密码

时间:2017-06-16 22:58:53      阅读:259      评论:0      收藏:0      [点我收藏+]

centos 7 + mysql 5.7.13重置root密码步骤:

# vi /etc/my.cnf  # [mysqld]下skip-grant-tables 内容前添加#


# mysql -uroot -p 连续输入enter 进入


# use mysql


# update mysql.user set authentication_string=PASSWORD(‘redhat‘) where User=‘root‘;

# grant all privileges on *.*  to root@‘%‘ identified by  ‘redhat‘; (授权,不然navicat等无法登录数据库)。


# vi /etc/my.cnf  # [mysqld]下skip-grant-tables 内容前去掉#


#systemctl status mysql.service  重启mysql数据库服务。

        

        再登录数据库即可。


本文出自 “敬管叔鲜” 博客,谢绝转载!

centos 7 + mysql 5.7.13 重置数据库的root密码

原文:http://9285090.blog.51cto.com/9275090/1939126

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!