zoukankan      html  css  js  c++  java
  • DCL--数据控制语言

    1.授权命令 grant

    #1.授权
    grant all on *.* to root@'172.16.1.%' identified by '123';
    #应该授权低一点的权限
    grant select,update,insert on database.* to dev@'172.16.1.%' identified by 'Lhd@123456'
    
    #2.查看用户权限
    mysql> show grants for root@'localhost';
    
    #3.特殊权限授权
    max_queries_per_hour:一个用户每小时可发出的查询数量
    max_updates_per_hour:一个用户每小时可发出的更新数量
    
    max_connections_per_hour:一个用户每小时可连接到服务器的次数
    mysql> grant all on *.* to lhd@'localhost' identified by '123' with max_connections_per_hour 1;
    
    max_user_connections:允许同时连接数量
    mysql> grant all on *.* to test@'localhost' identified by '123' with max_user_connections 2;

    2.回收权限 revoke

    #1.回收权限
    mysql> revoke drop on *.* from test@'localhost';
    
    #2.查看权限
    mysql> show grants for test@'localhost';
    
    #3.所有权限
    SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE

    3.授权一个超级管理员

    mysql> grant all on *.* to superuser@'localhost' identified by 'Lhd@123456' with grant option;
  • 相关阅读:
    HDU 4492 Mystery (水题)
    UVA 10480 Sabotage (最大流)
    POJ 2446 Chessboard (二分匹配)
    VS2008下用MFC 的MSComm控件编写串口程序
    退役了~~~
    STL Algorithms 之 unique
    cocos2d中CCCallFuncND传参数的注意事项
    好太太晾衣架市场价格表(仅供参考)
    Linux VNC黑屏(转)
    C++ TinyXml操作(含源码下载)
  • 原文地址:https://www.cnblogs.com/chenlifan/p/13907183.html
Copyright © 2011-2022 走看看