用oneinstack安装的mysql忘记密码后怎么办?
2017-04-25 13:45
633 查看
参考:https://oneinstack.com/question/1914/
忘记root密码更改方法:
1)在my.cnf里的[mysqld]里添加skip-grant-tables,restart mysql
service mysql restart
/bin/systemctl restart mysql.service
2)用mysql命令登陆,注意,只有这5个字符,不带其它东西。
3)更改到mysql这个数据库use mysql
4)使用update命令更改 update user set password=password(‘new_password’) where user=’root’;
mysql5.7版本:
update mysql.user set authentication_string=password('test123') where user='root' and Host = 'localhost';
5)成功后,使用flush privileges;刷新一下即可。别忘记把my.cnf里的skip-grant-tables前加“#”,
再restart mysql一下。
或者grep dbrootpwd /root/oneinstack/options.conf
忘记root密码更改方法:
1)在my.cnf里的[mysqld]里添加skip-grant-tables,restart mysql
service mysql restart
/bin/systemctl restart mysql.service
2)用mysql命令登陆,注意,只有这5个字符,不带其它东西。
3)更改到mysql这个数据库use mysql
4)使用update命令更改 update user set password=password(‘new_password’) where user=’root’;
mysql5.7版本:
update mysql.user set authentication_string=password('test123') where user='root' and Host = 'localhost';
5)成功后,使用flush privileges;刷新一下即可。别忘记把my.cnf里的skip-grant-tables前加“#”,
再restart mysql一下。
或者grep dbrootpwd /root/oneinstack/options.conf
相关文章推荐
- Mac安装mysql(忘记初始的默认密码怎么办?)
- mac安装mysql初始密码忘记怎么办
- mysql 忘记密码怎么办?lunix系统安装
- Mac安装mysql,忘记密码怎么办
- mac安装mysql初始密码忘记怎么办
- Ubuntu下忘记mysql密码怎么办?
- 忘记了mysql的密码怎么办?
- MySQL 忘记root密码 重新安装 干净卸载 清除原root密码方法 (Window系统)
- MySql忘记root密码怎么解决
- MySQL密码忘记后该怎么办
- 忘记MySQL的root密码,进不了mysql怎么办?
- redhat enterpriseredhat 5.4 下mysql忘记密码怎么办
- 忘记mysql密码怎么办
- MySQL忘记密码怎么办
- mysql忘记密码了怎么办?
- 忘记了mysql密码怎么办
- 忘记MySQL密码怎么办
- mysql 忘记密码怎么办
- 忘记Mysql的root密码怎么办!
- CentOS 5.5 安装Apache+MySQL+PHP(yum直接安装,mysql自动备份,mysql忘记密码的找回方法)