在mysql文件夹中的my.ini末尾加入
skip-grant-tables 保存 关闭。
cmd
C:\Users\Administrator>cd "C:\Program Files\MySQL\MySQL Serve
C:\Program Files\MySQL\MySQL Server 5.0\bin>net stop mysqlMySQL 服务正在停止.
MySQL 服务已成功停止。
C:\Program Files\MySQL\MySQL Server 5.0\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
然后在打开mysql.exe
Enter password:(回车,密码为空)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
Database changed
mysql> update user set password='新密码' where user='root'
-> flush privileges;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'flush
privileges' at line 2
mysql> flush privileges