Unix&Linux:
1.用root或者运行mysqld的用户登录系统;
2.利用kill命令结束掉mysqld的进程;
3.使用--skip-grant-tables参数启动MySQL Server
shell>;mysqld_safe --skip-grant-tables &(写全路径)
4.为root@localhost设置新密码
shell>;mysqladmin -u root flush-privileges password "newpassword",
或直接进入mysql表中修改Password
如:
>;use mysql
>;update user set password=password("new_pass" where user="root";
>;flush privileges;
重置MySQL root密码
本文介绍了一种在Unix/Linux环境下重置MySQL root用户密码的方法,包括使用root权限停止mysqld进程、启动MySQL服务器跳过权限表检查以及更新root用户的密码。
4740

被折叠的 条评论
为什么被折叠?



