create user 'aaa'@'%' identified by 'aaaaaa';
grant all privileges on *.* to 'aaa';
commit;
flush privileges;
用root登录,
use mysql;
然后把user表清一下:
delete from user where User = 'root' and Host != 'localhost';
delete from user where User ="";
delete from user where User is null;
用root登录,然后把root密码设置一下:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');