wslnb 发表于 2007 年 4 月 29 日 16:37:31

介绍一个在所有版本linux的grub上均可以使用的方法:

1、在Grub的引导装载程序菜单上,选择你要进入的条目,键入 “e” 来进入编辑模式;

2、在第二行(类似于kernel /vmlinuz-2.6.15 ro root=/dev/hda2 ),键入”e”进入编辑模式;

3、在句末加上”init=/bin/bash”,回车;

4、按“b”启动系统。

这样我们即可获得一个bash的shell,进入shell后,根分区的挂载模式默认是只读,我们要将其改为可写,否则不能更改root密码:

mount -no remount,rw /
passwd root
sync
mount -no remount,ro /
reboot

这样即可成功更改debian的root用户的密码。


走前灌水

迷路林肯 发表于 2007 年 4 月 29 日 16:37:34

我的mysql为MySQL - 5.0.23:

1、在开始菜单“运行”栏里输入“CMD”,进入到了命令行下
C:\Documents and Settings\millken>
C:\Documents and Settings\millken>net stop mysql            
C:\Documents and Settings\millken>mysqld-nt --skip-grant-tables
C:\Documents and Settings\millken>

2、新开一个CMD窗口:
*************************************************************************
Microsoft Windows [版本 5.2.3790]
(C) 版权所有 1985-2003 Microsoft Corp.

C:\Documents and Settings\millken>mysql -u root
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 5.0.23-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql
Database changed
mysql> update user set password=password("root") where host="localhost" and user="root";
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1Changed: 0Warnings: 0

mysql> set password for "root"@"localhost"=old_password("root");
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables
option so it cannot execute this statement
mysql> exit;
Bye

C:\Documents and Settings\millken>d:

D:\>mysqladmin -u root shutdown

D:\>net start mysql

MySQL 服务已经启动成功。


D:\>cd www

D:\WWW>cd mysql

D:\WWW\MYSQL>cd bin

D:\WWW\MYSQL\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 35 to server version: 5.0.23-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> set password for 'root'@'localhost'=old_password("root");
Query OK, 0 rows affected (0.00 sec)

mysql>



至此就大功告成了,注意一点的是因为5.0.1版Mysql的password算法和3.23.44的算法不一样了,所以要运行最后一句,不然phpmyadmin下会进不了。



LINUX下大致一样,就是命令稍有不同

wode998 发表于 2007 年 4 月 29 日 16:39:02

相信11楼的

aiqingdao3 发表于 2007 年 4 月 29 日 16:41:05

我华丽的飘过..........

wslnb 发表于 2007 年 4 月 29 日 16:41:56

别信我。。。套套用LINUX用的多,找他
其实最方便的还是找个最新的溢出程序,入侵最方便。。
最多是个“日”本人。。

nuet 发表于 2007 年 4 月 29 日 16:52:04

;P ;P ;P ;P 是不是有文件有记录的啊
页: 1 [2]
查看完整版本: linux下mysql的root密码忘了