基于windows 7系统的mysql root用户密码修改
1.修改mysql根目录下my.ini文件,在最后一行添加:skip-grant-tables
2.CMD控制台
net stop mysql
net start mysql
3.mysql -u root -p 不输入密码
4.use mysql
5.update user set password=PASSWORD('new password') where user='root';
user表中有两条root记录,区别这两条记录的host字段值分别为localhost和%
%:允许任意的主机连接MySQL服务器,这是非常不安全的,给攻击者造成可乘之机,我们必须删除Host字段为%的 记录:mysql>delete from user where host='%';
6.exit
7.net stop mysql
net start mysql