1.创建用户,指定哪个表空间create user test2 identified by "123" default tablespace BDCDJ_XC temporary tablespace BDCDJ_XC_temp; 2.创建角色 CREATE ROLE SELECT_ROLE 3.给角色分配权限 grant connect to SELECT_ROLE; grant create synonym to SELECT_ROLE; 4.分配某些表的select权限如:gra…
创建只读用户:grant connect to user; grant create session to user; 1.创建角色 CREATE ROLE SELECT_ROLE 2.给角色分配权限 grant SELECT ANY DICTIONARY to SELECT_ROLE; grant SELECT ANY TABLE to SELECT_ROLE; grant SELECT ANY TRANSACTION to SELECT_ROLE; grant SELECT ANY SEQU…
GRANT Select ON *.* TO reader@192.168.1.123 IDENTIFIED BY "123456" GRANT 可以立刻生效 在mysql 5.6下似乎要重启mysql才生效 创建了一个账户名为“reader" , 密码”123456“ 只可以从192.168.1.123发起访问 读取数据库的账号 reader@"%" 则表示所有的ip都可以访问 参考: http://linux.chinaitlab.com…
应用场景:只要公司有数据团队的,那免不了让这帮家伙把全公司的数据库数据都摸一遍,但是要是直接把root用户给了他们,未免有点危险,于是只能给这帮人设权限,一般而言,他们只是做读操作,既然做读操作,那么只要有个select权限就可以了. 我们可以通过GRANT来创建用户: GRANT SElECT ON *.* TO 'read_only_user'@'ip' IDENTIFIED BY "pa$$word" 其实这个语句与开通远程连接差不多,read_only_user就是用户名,随便…
1.创建角色 CREATE ROLE SELECT_ROLE 2.给角色分配权限 grant CREATE VIEW to SELECT_ROLE; grant CREATE SYNONYM to SELECT_ROLE; grant CONNECT TO SELECT_ROLE;grant SELECT ANY DICTIONARY to SELECT_ROLE; grant SELECT ANY TABLE to SELECT_ROLE; grant SELECT ANY TRANSACTI…
基本环境信息target DB (需备份数据库) 192.168.199.67 ORACLE_SID=zgw HOSTNAME=Oracle11 catlog DB (备份管理数据库) 192.168.199.68 ORACLE_SID=rman HOSTNAME=Oracle11_2 创建rman账号及相关设置 sqlplus / as sysdba select file_name, tablespace_name from dba_data_files group by tablespac…
mysql 创建只读账户: 1.查询所有账号信息 SELECT DISTINCT a.`User`,a.`Host`,a.password_expired,a.password_last_changed,a.password_lifetime,a.* FROM mysql.user a; 示例: 1.创建账户 并授权SELECT查询权限. > GRANT SELECT ON dbname.* TO 'username'@'%' IDENTIFIED BY "password";…