mysql恢复,mysql 恢复密码

mysql 恢复密码 2008-06-25 10:50:38 www.hackbase.com 来源:互联网
mysql 恢复密码 OS:[root@localhost ~]# cat /etc/redhat-release CentOS release 4.4 (Final)Mysql Version:version: 4.1.20-log step 1: ./mysqld_safe --skip-grant-tables & [root@localhost ~]# ps u ...
mysql 恢复密码
OS:
[root@localhost ~]# cat /etc/redhat-release
CentOS release 4.4 (Final)
Mysql Version:
version: 4.1.20-log
step 1:
./mysqld_safe --skip-grant-tables &
[root@localhost ~]# ps ux
root 4976 0.2 0.2 5328 1160 pts/1 S+ 11:43 0:00 /bin/sh /usr/bin/mysqld_safe --skip-grant-tables
[root@localhost ~]# netstat -ant|grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
step 2:
[root@localhost ~]# /usr/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.20-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
Database changed
mysql> update user set password=password('') where user='root';
Query OK, 0 rows affected (0.01 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)
mysql> quit
Bye
[root@localhost ~]# ps ux
root 4976 0.0 0.2 5328 1160 pts/1 S+ 11:43 0:00 /bin/sh /usr/bin/mysqld_safe --skip-grant-tables
[root@localhost ~]# kill -9 4976
[root@localhost ~]# /etc/init.d/mysqld start
Starting MySQL: [ OK ]
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.20-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
本篇文章来源于 黑基网-中国最大的网络安全站点 原文链接:http://www.hackbase.com/tech/2008-06-25/41110.html
Tags:  mysql恢复

延伸阅读

最新评论

发表评论