1. mysql> use mysql;
    2. Database changed
    3. mysql> grant all privileges on *.* to root@'%' identified by "password";
    4. 可以指定某一个数据库
    5. grant all privileges on 数据库.表 to root@'%' identified by "指定的密码";
    6. grant all privileges on your_db.* to root@'%' identified by "password";
    7. your_db的所有表
    8. Query OK, 0 rows affected (0.00 sec)
    9. mysql> flush privileges;
    10. Query OK, 0 rows affected (0.00 sec)
    11. mysql> select host,user,password from user;
    12. +--------------+------+-------------------------------------------+
    13. | host | user | password |
    14. +--------------+------+-------------------------------------------+
    15. | localhost | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
    16. | 192.168.1.1 | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
    17. | % | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
    18. +--------------+------+-------------------------------------------+
    19. 3 rows in set (0.00 sec)