grant

数据库系统概论(第五版) 王珊 第四章课后习题答案

笑着哭i 提交于 2019-12-23 19:24:10
1 .什么是数据库的安全性? 答:数据库的安全性是指保护数据库以防止不合法的使用所造成的数据泄露、更改或破坏。 2 .数据库安全性和计算机系统的安全性有什么关系? 答:安全性问题不是数据库系统所独有的,所有计算机系统都有这个问题。只是在数据库系统中大量数据集中存放,而且为许多最终用户直接共享,从而使安全性问题更为突出。 系统安全保护措施是否有效是数据库系统的主要指标之一。 数据库的安全性和计算机系统的安全性,包括操作系统、网络系统的安全性是紧密联系、相互支持的, 3 .试述实现数据库安全性控制的常用方法和技术。 答:实现数据库安全性控制的常用方法和技术有: ( l )用户标识和鉴别:该方法由系统提供一定的方式让用户标识自己的名字或身份。每次用户要求进入系统时,由系统进行核对,通过鉴定后才提供系统的使用权。 ( 2 )存取控制:通过用户权限定义和合法权检查确保只有合法权限的用户访问数据库,所有未被授权的人员无法存取数据。例如CZ 级中的自主存取控制( DAC ) , Bl 级中的强制存取控制(MAC )。 ( 3 )视图机制:为不同的用户定义视图,通过视图机制把要保密的数据对无权存取的用户隐藏起来,从而自动地对数据提供一定程度的安全保护。 ( 4 )审计:建立审计日志,把用户对数据库的所有操作自动记录下来放入审计日志中,DBA 可以利用审计跟踪的信息

MySQL Grant for more than one database

泪湿孤枕 提交于 2019-12-23 18:47:50
问题 I'm trying to set the privileges for two databases at once. I know it is possible to assign them in two statements. Is there a way to do it in one? I tried GRANT ALL PRIVILEGES ON mydb1.*, mydb2.* TO 'reader'@'localhost' IDENTIFIED BY 'mypassword'; But it only seems to work for one database. 回答1: No you can't, as you can see in the GRANT syntax diagram. Although apparently, you can use the wildcard *.* to apply the grant to all databases, but I wouldn't do that. 回答2: You can either grant

How to use GRANT with variables?

喜欢而已 提交于 2019-12-23 16:34:34
问题 I have some troubles with GRANT and variables together in MySql. SET @username := 'user123', @pass := 'pass123'; GRANT USAGE ON *.* TO @username@'%' IDENTIFIED BY @pass; GRANT INSERT (header1, header2, headern) ON `data` TO @username@'%'; GRANT SELECT (header1, header2) ON `data2` TO @username@'%'; I'd like to put username and password into variables at the begining of the script and then later use them in GRANT So instead of this: GRANT USAGE ON *.* TO 'user123'@'%' IDENTIFIED BY 'pass123';

managing user privileges in sqlalchemy

随声附和 提交于 2019-12-23 12:53:12
问题 I have an sqlalchemy script that creates and uses many engine instances representing many user connections. All the engines are configured to point to the same postgres database. I have one engine, oSuperEngine that can do super stuff. I have another engine 'oBobsEngine` for Bob. Now I'm doing something like this: sSQL = "GRANT ALL PRIVILEGES ON TABLE \"NICE_TABLE\" to bob;" oSuperEngine.execute(sSQL) sSQL = "insert into \"NICE_TABLE\" (foo) values (bar)" oBobsEngine.execute(sSQL) # ERROR

Mysql 安装-操作-备份

瘦欲@ 提交于 2019-12-23 03:37:33
lower_case_table_names = 0 Mysql 5.7 安装windows 1.配置mysql的path->系统属性->环境变量-path添加最后 2.配置目录和主从 [mysqld] port = 3306 basedir=C:\Users\Administrator\Desktop\mysql-5.7.15-winx64\ datadir=C:\Users\Administrator\Desktop\mysql-5.7.15-winx64\data max_connections=200 character-set-server=utf8 default-storage-engine=INNODB #skip-grant-tables max_allowed_packet = 16M skip-name-resolve lower_case_table_names=1 server-id = 1 log-bin=mysql-bin binlog_format=mixed expire_logs_days = 10 3.安装启动服务 mysqld install 4.初始化 mysqld --initialize --user=mysql --console mysqld --initialize-insecure --user=mysql mysqld -

Query GRANTS granted to a sequence in postgres

自古美人都是妖i 提交于 2019-12-22 04:27:07
问题 To query GRANTS granted to a table I can use a query like: SELECT grantee, privilege_type FROM information_schema.role_table_grants WHERE table_name='mytable' (see my old question here: Query grants for a table in postgres) But how I query the GRANTS grated to a sequence? 回答1: I've looked through the source code, and I can't find any place that exposes the ACL for sequences through the information_schema tables. (I could have missed something, though.) PostgreSQL does expose the ACL for

Oracle Create View issue

六眼飞鱼酱① 提交于 2019-12-21 12:18:04
问题 Hey guys. So, I am logged in as the dba account and I want to create a view in User1's schema, but selecting data from User2's. I used the following query: CREATE OR REPLACE VIEW User1.NewView (Column1) AS SELECT DISTINCT Column1 FROM User2.Table and I get the following error: SQL Error: ORA-00942: table or view does not exist 00942. 00000 - "table or view does not exist" *Cause: *Action: To resolve this I had to grant select access to User1 on User2.Table. Is there a way to do this without

oracle 常用操作记录--持续更新...

白昼怎懂夜的黑 提交于 2019-12-20 11:39:04
一、oracle grant 授权语句(转自:https://www.cnblogs.com/yt954437595/p/6488819.html) --select * from dba_users; 查询数据库中的所有用户   --alter user TEST_SELECT account lock; 锁住用户   --alter user TEST_SELECT account unlock; 给用户解锁   --create user xujin identified by xujin; 建立用户   --grant create tablespace to xujin; 授权   --grant select on tabel1 to xujin; 授权查询   --grant update on table1 to xujin;   --grant execute on procedure1 to xujin 授权存储过程   --grant update on table1 to xujin with grant option; 授权更新权限转移给xujin用户,许进用户可以继续授权;   --收回权限   --revoke select on table1 from xujin1; 收回查询select表的权限;   --revoke all on table1

MySQL创建用户与授权方法

白昼怎懂夜的黑 提交于 2019-12-18 17:17:02
【文章来源:脚本之家 地址:https://www.jb51.net/article/31850.htm】 MySQL中创建用户与授权的实现方法,对于刚开始接触mysql的朋友可以参考下 注:我的运行环境是widnows xp professional + MySQL5.0 一, 创建用户: 命令:CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 说明:username - 你将创建的用户名, host - 指定该用户在哪个主机上可以登陆,如果是本地用户可用localhost, 如果想让该用户可以从任意远程主机登陆,可以使用通配符%. password - 该用户的登陆密码,密码可以为空,如果为空则该用户可以不需要密码登陆服务器. 例子: CREATE USER 'dog'@'localhost' IDENTIFIED BY '123456'; CREATE USER 'pig'@'192.168.1.101_' IDENDIFIED BY '123456'; CREATE USER 'pig'@'%' IDENTIFIED BY '123456'; CREATE USER 'pig'@'%' IDENTIFIED BY ''; CREATE USER 'pig'@'%'; 二,授权: 命令:GRANT

MySQL Stored Procedure Permissions

风格不统一 提交于 2019-12-18 11:48:50
问题 I am trying to give a user permission to run a stored procedure at the stored procedure level on a MySQL Database rather than allowing a user to execute any stored procedure in the database. I was trying to execute the following code: GRANT EXECUTE ON myDB.spName TO 'TestUser'@'localhost'; But i keep getting the following error: Illegal GRANT/REVOKE command, please consult the manual to see which privileges can be used. I tried changing it to the following: GRANT EXECUTE ON PROCEDURE myDB