JAVA网络爬虫
HttpClient

导航

 
  1. 进入mysql

    mysql -uroot -p;
    
  2. 允许主机ip为100.64.25.217用root用户来访问test4下面的所有的表使用的密码是123456:

    grant all privileges on test4.* to 'root'@'100.64.25.217' identified by  '123456' with grant option;
    
  3. 让授权生效:

    flush privileges;
    
  4. 允许所有人在任何主机上用root用户来访问test4数据库下的所有表:

    grant all privileges on test4.* to 'root'@'%' identified by  '123456' with grant option;
    
  5. 让授权生效:

    flush privileges;
    
  6. 解释

    all privileges:表示将所有权限授予给用户。也可指定具体的权限,如:SELECT、CREATE、DROP等。
    
    on:表示这些权限对哪些数据库和表生效,格式:数据库名.表名,这里写“*”表示所有数据库,所有表。如果我要指定将权限应用到test库的user表中,可以这么写:test.user
    
    to:将权限授予哪个用户。格式:”用户名”@”登录IP或域名”。%表示没有限制,在任何主机都可以登录。比如:”xiaoge”@”192.168.0.%”,表示xiaoge这个用户只能在192.168.0IP段登录
    
    identified by:指定用户的登录密码
    
    with grant option:表示允许用户将自己的权限授权给其它用户
    
posted on 2019-05-02 21:16  gmlgxx  阅读(55)  评论(0)    收藏  举报