MySQL忘记密码的正确解决方法

来源:互联网 发布:软件测试项目实例 编辑:程序博客网 时间:2024/06/03 23:49


windows

1:停止MySQL的服务。

2:跳过权限检查启动MySQL,

c:\mysql\bin>mysqld-nt ––skip-grant-tables

或则:c:\mysql\bin>mysqld ––skip-grant-tables

mysqld.exe是微软Windows MySQL server数据库服务器相关程序。mysqld-nt.exe是MySQL Daemon数据库服务相关程序。

3:重新打开一个窗口

进入c:\mysql\bin目录,设置root的新密码

c:\mysql\bin>mysqladmin -u root flush-privileges password "newpassword"


Linux

1:service mysqld stop;

2 :mysqld_safe –skip-grant-tables &

3:mysql -u root -p

4: update user set Password=password('newpassword') where User='root';



0 0
原创粉丝点击