mysql>use mysql;mysql>grant all on *.* to 数据库登录名字@"%" identified by "数据库的密码";mysql>FLUSH PRIVILEGES;mysql>quit;
最后重启一下数据库
service mysqld restart