登录站点

用户名

密码

注册

查看日志|返回日志列表

Windows下修改mysql root密码

标签root  mysql  密码  Windows  2009-02-16 13:56

打开命令行窗口输入

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-nt

Type ‘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-nt

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

mysql>

成功!

分享 791 次阅读 | 0 个评论

留下脚印

评论