1、停用MySQL服务:# service mysql stop
2、输入命令: # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3、登入数据库: #mysql -u root mysql
4、mysql> user mysql;
5、查询user表中的结果(select user,host,password from user;),删除表中查询到的空用户(delete from user where user ='');
6、退出数据库: mysql>quit
7、启动mysql 服务: # service mysql start;
8、重新用命令'mysql -u root -p'登录,OK!