首页 > 代码库 > mysql 忘记root密码
mysql 忘记root密码
1、停止服务:
service mysqld stop
2、修改my.cnf:
1 vim /etc/my.cnf 2 3 # 添加 4 skip-grant-tables
3、启动服务:
service mysqld start
4、登陆并修改密码:
1 # 登陆数据库 2 mysql 3 # 修改密码 4 update mysql.user set password=password(‘newpassword‘) where user=‘root‘
5、密码修改完成后,将my.cnf文件中添加的skip-grant-tables语句注释或删除掉,然后重启数据库即可
mysql 忘记root密码
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。