更改

跳转至: 导航搜索

如何在Linux(CentOS)下重置MySQL根(Root)密码

添加915字节, 2016年7月3日 (日) 18:57
无编辑摘要
3.输入“service mysqld stop”命令停止mysqld服务。
[[File:MySQLRoot3.png]]
4.输入“mysqld_safe --skip-grant-tables &”命令以无密码方式进入MySQL安全模式。
[[File:MySQLRoot4.png]]
5.输入“mysql -u root”并按回车键即可。
[[File:MySQLRoot5.png]]
6.输入“use mysql;”挂载数据库。
注意:请勿忘记在最后输入分号(;)。
[[File:MySQLRoot6.png]]
7.输入"update user set password=password("New9ssw0rd") where user='root';"将Root密码修改为New9ssw0rd。
[[File:MySQLRoot7.png]]
8.输入"flush privileges;"更新权限。
[[File:MySQLRoot8.png]]
9.输入“quit”并按回车键退出。
注意:此处不需输入分号。
[[File:MySQLRoot9.png]]
10.输入"service mysqld restart"重启mysqld服务。
[[File:MySQLRoot10.png]]
11.输入“mysql -u root -p”并按回车键提示输入密码。
[[File:MySQLRoot11.png]]
12.输入新密码New9ssw0rd并按回车键,提示已经成功登录。
[[File:MySQLRoot12.png]]
匿名用户

导航菜单