网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   服务器环境搭建 (https://www.0058.net/forumdisplay.php?f=5)
-   -   忘记MySQL密码的更改方法 (https://www.0058.net/showthread.php?t=85)

sunshine 2006-02-04 11:06 PM

忘记MySQL密码的更改方法
 
这种事情很少会碰到,不过如果碰到的话,不妨试试
1、在linux中
如果 MySQL 正在运行,首先杀之: killall -TERM mysqld
启动 MySQL :/usr/bin/safe_mysqld --skip-grant-tables
就可以不需要密码就进入 MySQL 了。
然后就是
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
重新杀 MySQL ,用正常方法启动 MySQL 。
2、在windows中
如果mysql正在运行,不要关闭
执行:
mysqld --skip-grant-tables
命令
这时如果看到屏幕没反应,表示服务已启动
在一个新窗口中运行
mysql
可以不用密码登录
update user set password=password("new_pass") where user="root";
杀掉mysqld 的进程

OK!


All times are GMT +8. The time now is 06:28 PM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.