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;
  • 相关阅读:
    C#编程:依赖倒置原则DIP
    java项目与javaweb项目导入jar包的区别
    《C#从入门到精通(第3版)》目录
    Sublime Text 格式化代码
    ThinkPHP 入门
    CentOS 7.2配置LAMP环境——yum版
    打包名命令:tar
    不规则数组的构建
    Linux文件权限概念
    tomcat启动成功但是没有监听8080端口
  • 原文地址:https://www.cnblogs.com/chenlifan/p/13907183.html
Copyright © 2011-2022 走看看