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;
  • 相关阅读:
    LeetCode——37. 解数独
    LeetCode ——42. 接雨水
    异常
    IO/FILE
    函数与模块
    选择与循环
    运算符
    字符串、列表、元组等
    SVTyper
    Error:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-not69mld/pysam/
  • 原文地址:https://www.cnblogs.com/chenlifan/p/13907183.html
Copyright © 2011-2022 走看看