默认情况下Linux内的mysql数据库mysql,user表内的用户权限只是对localhost即本机才能登陆。需要更改权限为以下结果:
mysql> use mysql;
Database changed
mysql> select host,user from user;
+------+------+
| host | user |
+------+------+
| % | root |
+------+------+
1 row in set (0.00 sec)
mysql>
即将user=root的host由localhost修改为%
mysql> use mysql;
Database changed
mysql> select host,user from user;
+------+------+
| host | user |
+------+------+
| % | root |
+------+------+
1 row in set (0.00 sec)
mysql>
即将user=root的host由localhost修改为%