adsense

2011-03-05

[mysql] 密碼忘記

cmd底下

C:\AppServ\mysql\bin>net stop mysql

MySQL 服務正在停止.
MySQL 服務已經成功停止。

C:\AppServ\mysql\bin>mysqld --skip-grant-tables --user=root &

再開一個命令提示的畫面
C:\Documents and Settings\Administrator>cd c:\app*

C:\AppServ>cd my*

C:\AppServ\mysql>cd bin

C:\AppServ\mysql\bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.24-debug

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

mysql>

mysql> use mysql;
Database changed
mysql>

mysql> update user set password=password('a123') where user='root';
Query OK, 1 row affected (0.06 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye


開啟工作管理員

Kill mysql 程式

開啟cmd
C:\AppServ\mysql\bin>net start mysql
MySQL 服務正在啟動 .
MySQL 服務已經啟動成功。


C:\AppServ\mysql\bin>mysql -u root -p
Enter password:



沒有留言:

張貼留言