解决mysql不能远程连接

[root@test html]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 55
Server version: 5.1.69 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> grant all privileges  on *.* to root@'%' identified by "密码";     授权root用户远程登录
Query OK, 0 rows affected (0.00 sec)

mysql> select host,user,password from user;
+-----------+------+----------+
| host      | user | password |
+-----------+------+----------+
| localhost | root |          |
| test.cn   | root |          |
| 127.0.0.1 | root |          |
| localhost |      |          |
| test.cn   |      |          |
| %         | root |          |
+-----------+------+----------+
6 rows in set (0.00 sec)

2013年11月21日, PM 02:16:14

点赞