zoukankan      html  css  js  c++  java
  • 实验四 数据库安全设计

    实验四 数据库安全设计

    数据库维护人员(1人):可对订单数据库进行任何操作。
    账号名称:system_dbowner,密码为usercode1,允许任何ip通过此用户连接数据库

    all为所有权限

    订单数据库.*表示订单数据中的所有表

    system_dbowner 为用户名

    %表示所有ip地址

    usercode1为密码

    这句grant命令执行后如果数据库中没有对应的角色会自动创建

    grant all on 订单数据库.* to 'system_dbowner'@'%' identified by 'usercode1';
    
    数据录入人员(2人):可对订单数据库中所有表进行插入、删除、更新操作,
    (注意:为了顺利进行删除更新操作,也需要能有查询权限)
    不能创建与修改表结构及其它授权等操作。
    账号名称:datarecorder1, datarecorder2,密码为usercode1,允许任何ip通过此用户连接数据库
    grant select,insert,update,delete on 订单数据库.* to 'datarecorder1'@'%' identified by 'usercode1';
    grant select,insert,update,delete on 订单数据库.* to 'datarecorder2'@'%' identified by 'usercode1';
    
    订单管理人员(2人):能对订单数据库中的订单表和订货项目表进行插入、删除、更新操作,
    其它表仅能查询(注意:为了顺利进行删除更新操作,订单表和订货项目表也需要能有查询权限)。
    不能创建与修改表结构及其它授权等操作。
    账号名称:order_1,order_2,密码为usercode1,允许任何ip通过此用户连接数据库
    --授予订单数据库所有表的查询权限
    grant select on 订单数据库.* to 'order_1'@'%' identified by 'usercode1';
    grant select on 订单数据库.* to 'order_2'@'%' identified by 'usercode1';
    -- 授予订单数据库订单表和订货项目表的增删改权限
    grant insert,update,delete on 订单数据库.订单 to 'order_1'@'%' identified by 'usercode1';
    grant insert,update,delete on 订单数据库.订单 to 'order_2'@'%' identified by 'usercode1';
    grant insert,update,delete on 订单数据库.订货项目 to 'order_1'@'%' identified by 'usercode1';
    grant insert,update,delete on 订单数据库.订货项目 to 'order_2'@'%' identified by 'usercode1';
    
    客户管理人员(2人):能对订单数据库中的代理商表和客户表进行插入、删除、更新,
    其它表仅能查询(注意:为了顺利进行删除更新操作,代理商表和客户表也需要能有查询权限)。
    不能创建与修改表结构及其它授权等操作。
    账号名称:customer_1, customer_2,密码为usercode1,允许任何ip通过此用户连接数据库
    -- 赋予登陆权限
    grant usage on *.* to 'customer_2'@'%' identified by 'usercode1';
    grant usage on *.* to 'customer_1'@'%' identified by 'usercode1';
    -- 赋予对订单数据库查询权限
    grant select on 订单数据库.* to 'customer_2'@'%' identified by 'usercode1';
    grant select on 订单数据库.* to 'customer_1'@'%' identified by 'usercode1';
    -- 赋予对代理商和客户表的增删改权限
    grant insert,update,delete on 订单数据库.客户 to 'customer_2'@'%' identified by 'usercode1';
    grant insert,update,delete on 订单数据库.客户 to 'customer_1'@'%' identified by 'usercode1';
    grant insert,update,delete on 订单数据库.代理商 to 'customer_2'@'%' identified by 'usercode1';
    grant insert,update,delete on 订单数据库.代理商 to 'customer_1'@'%' identified by 'usercode1';
    
  • 相关阅读:
    windows下phpunit installing[转]
    一个简单的文件后缀获取——不是通过文件名,而是文件内容
    二进制加法
    收藏一个韩国棒子的未知高度居中方法
    带超时+POST/GET方式的获取远程文件,利用file_get_contents
    较深度地递归转义过滤
    利用单元测试在每个层上对 PHP 代码进行检查[转IBM]
    提取TP的一个格式化为json的针对的原始类型函数
    分享一个正则方式的UTF8/GBK中文切割
    NewBaldwinFlash的登场(稍简单的DNN模块)
  • 原文地址:https://www.cnblogs.com/lightice/p/12732178.html
Copyright © 2011-2022 走看看