打开命令行窗口输入
d:\Server\Mysql\bin\mysqld-nt –skip-grant-tables
启动另一个命令行窗口
d:\Server\Mysql\bin\mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.0.22-ntType ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> update mysql.user set password=PASSWORD(’test’) where User=’root’;
Query OK, 1 row affected (0.05 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql> \q
Bye
打开任务管理器结束掉mysqld-nt进程 启动mysql服务
d:\Server\Mysql\bin\mysql -uroot -ptest
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.22-ntType ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
成功!
评论