• 10 MySQL--权限管理




    权限管理
    1、创建账号 # 本地账号 create user 'egon1'@'localhost' identified by '123'; # mysql -uegon1 -p123 # 远程帐号 create user 'egon2'@'192.168.31.10' identified by '123'; # mysql -uegon2 -p123 -h 服务端ip create user 'egon3'@'192.168.31.%' identified by '123'; # mysql -uegon3 -p123 -h 服务端ip create user 'egon3'@'%' identified by '123'; # mysql -uegon3 -p123 -h 服务端ip 2、授权
        权限控制力度依次降低 user:
    *.* db:db1.* tables_priv:db1.t1 columns_priv:id,name
         # 库级别 grant all on
    *.* to 'egon1'@'localhost'; # 授权grant *.* 授权所有级别 grant select on *.* to 'egon1'@'localhost'; revoke select on *.* from 'egon1'@'localhost'; # 回收权限revoke
         授权库  grant select on db1.
    * to 'egon1'@'localhost'; revoke select on db1.* from 'egon1'@'localhost'; 授权表 grant select on db1.t2 to 'egon1'@'localhost'; revoke select on db1.t2 from 'egon1'@'localhost'; # 回收权限
    授权表下的字段 grant select(id,name),update(age) on db1.t2 to
    'egon1'@'localhost';

     select * from t2 ,,,        * 代表所有

  • 相关阅读:
    五分钟上手Markdown
    css中居中方法小结
    事务和同步锁
    插入排序
    插入排序
    交换排序
    eclipse 常用快捷键
    交换排序
    二叉搜索树(BST)
    二叉树遍历以及根据前序遍历序列反向生成二叉树
  • 原文地址:https://www.cnblogs.com/foremostxl/p/9765570.html
Copyright © 2020-2023  润新知