连接mysql数据库报错如下:

Error (1133): Can’t find any matching row in the user table

解决办法:

mysql> grant all on *.* to 'username'@'%' identified by 'password';

mysql> flush privileges;

*.*可以换成你要访问具体哪个数据库和具体哪张表

发生这一错误的原因是在变更了mysql.user表之后,没有使用FLUSH PRIVILEGES命令来更新权限表(grant tables)