zoukankan      html  css  js  c++  java
  • MySQL权限回收

    1.查看系统用户
    mysql> select user,host from mysql.user;
    +---------------+-----------+
    | user | host |
    +---------------+-----------+
    | root | 10.0.0.% |
    | wish | 10.0.0.% |
    | wish01 | 10.0.0.% |
    | wish02 | 10.0.0.% |
    | mysql.session | localhost |
    | mysql.sys | localhost |
    | root | localhost |
    +---------------+-----------+
    7 rows in set (0.00 sec)

    2.查看用户权限
    查看wish02用户的权限
    mysql> show grants for wish02@'10.0.0.%';
    +--------------------------------------------------------------------------------------+
    | Grants for wish02@10.0.0.% |
    +--------------------------------------------------------------------------------------+
    | GRANT SELECT, INSERT, UPDATE, DELETE ON . TO 'wish02'@'10.0.0.%' WITH GRANT OPTION |
    +--------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

    3.回收权限
    回收wish02用户delete权限
    mysql> revoke delete on . from 'wish02'@'10.0.0.%';
    Query OK, 0 rows affected (0.00 sec)

    再次查看wish02用户的权限,可以看到delete权限被回收了
    mysql> show grants for wish02@'10.0.0.%';
    +------------------------------------------------------------------------------+
    | Grants for wish02@10.0.0.% |
    +------------------------------------------------------------------------------+
    | GRANT SELECT, INSERT, UPDATE ON . TO 'wish02'@'10.0.0.%' WITH GRANT OPTION |
    +------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

  • 相关阅读:
    Freemaker:操作集合
    win10:在关闭防火墙下如何屏蔽特定端口
    win10:家庭版开启组策略
    oracle:10g下载地址(转载)
    mybatis:延迟加载时不要在get/set方法上面添加final关键字(原创)
    mybatis:在springboot中的配置
    mybatis:访问静态变量或方法
    maven:手动安装JAR到本地仓库
    datatables日常使用集合
    python 装饰器
  • 原文地址:https://www.cnblogs.com/w1sh/p/15707556.html
Copyright © 2011-2022 走看看