修改mysql允许远程连接

use mysql
 
 show tables;
 
mysql> select host from user;
+-----------------------+
| host                  |
+-----------------------+
| 127.0.0.1             |
| localhost             |
| localhost             |
| localhost.localdomain |
| localhost.localdomain |
+-----------------------+
5 rows in set (0.00 sec)
 
 
mysql> update user set host='%' where user='root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 1
mysql> select host from user where user='root';
+-----------------------+
| host                  |
+-----------------------+
| %                     |
| 127.0.0.1             |
| localhost.localdomain |
+-----------------------+
3 rows in set (0.01 sec)
 
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

posted on 2013-12-07 20:44  下一行code  阅读(167)  评论(0编辑  收藏  举报

导航