您的位置:首页 > 数据库 > MySQL

Mysql找回root密码

2016-06-07 12:20 387 查看
1.关闭数据库
# killall mysqld
2.使用--skip-grant-tables启动mysql,忽略授权登录验证。
# mysqld_safe --skip-grant-tables --user=mysql &
3.登入数据库
# mysql
4.修改密码
mysql> update mysql.user set password=password("123456") where user='root' and host='localhost';
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
5.重启数据库
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Linux 数据库