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)

  • 相关阅读:
    C#连接、访问MySQL数据库
    对列表遍历同时增删操作时注意事项 c
    Linux 操作命令 c
    Memcached 入门 转载与ferreousbox
    转载http://zxiaofei168.iteye.com/blog/1044843 spring事务管理
    spring mvc 学习 转载
    自定义Annotation
    Java的路径问题 转载
    设置火狐调试时间
    vi/vim 基本使用方法(转载)
  • 原文地址:https://www.cnblogs.com/w1sh/p/15707556.html
Copyright © 2011-2022 走看看