mysql密码重置

mysql密码丢失后重设密码的方法(Unix&Linux&winxp)

星期五, 九月 24th, 2010 | Database | 没有评论

记录供自己以后用时参考
1)不用密码登录
  [[email protected] local]# mysql
  ERROR 1045: Access denied for user: ‘[email protected]’ (Using password: NO)
  显示错误,说明密码已经修改。
修改方法:
Unix&Linux:
1.用root或者运行mysqld的用户登录系统;
2.利用kill命令结束掉mysqld的进程;
3.使用–skip-grant-tables参数启动MySQL Server
shell>;mysqld_safe –skip-grant-tables &(写全路径)
4.为[email protected]设置新密码
shell>;mysqladmin -u root flush-privileges password “newpassword”,或直接进入mysql表中修改Password
如:
>;use mysql
>;update user set password=password(“new_pass” where user=”root”;
>;flush privileges;
5.重启MySQL Server
› Continue reading

Tags: ,

Search

文章分类

Meta