当前位置:网站首页>GBase 8c 创建用户/角色 示例二
GBase 8c 创建用户/角色 示例二
2022-07-03 02:18:00 【大壮十二】
6、创建复制账号:repl
gbase=# CREATE USER repl REPLICATION LOGIN ENCRYPTED PASSWORD 'repl';
CREATE ROLE
7、其他说明
GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
[, ...] | ALL [ PRIVILEGES ] }
ON { [ TABLE ] table_name [, ...]
| ALL TABLES IN SCHEMA schema_name [, ...] }
TO role_specification [, ...] [ WITH GRANT OPTION ]
##单表授权:授权zjy账号可以访问schema为zjy的zjy表grant select,insert,update,delete on zjy.zjy to zjy;
##所有表授权:grant select,insert,update,delete on all tables in schema zjy to zjy;
GRANT { { SELECT | INSERT | UPDATE | REFERENCES } ( column_name [, ...] )
[, ...] | ALL [ PRIVILEGES ] ( column_name [, ...] ) }
ON [ TABLE ] table_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
##列授权,授权指定列(zjy schema下的zjy表的name列)的更新权限给zjy用户grant update (name) on zjy.zjy to zjy;
##指定列授不同权限,zjy schema下的zjy表,查看更新name、age字段,插入name字段grant select (name,age),update (name,age),insert(name) on zjy.xxx to zjy;
GRANT { { USAGE | SELECT | UPDATE }
[, ...] | ALL [ PRIVILEGES ] }
ON { SEQUENCE sequence_name [, ...]
| ALL SEQUENCES IN SCHEMA schema_name [, ...] }
TO role_specification [, ...] [ WITH GRANT OPTION ]
##序列(自增键)属性授权,指定zjy schema下的seq_id_seq 给zjy用户grant select,update on sequence zjy.seq_id_seq to zjy;
##序列(自增键)属性授权,给用户zjy授权zjy schema下的所有序列grant select,update on all sequences in schema zjy to zjy;
GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [, ...] | ALL [ PRIVILEGES ] }
ON DATABASE database_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
##连接数据库权限,授权cc用户连接数据库zjygrant connect on database zjy to cc;
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON DOMAIN domain_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON FOREIGN DATA WRAPPER fdw_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON FOREIGN SERVER server_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { EXECUTE | ALL [ PRIVILEGES ] }
ON { { FUNCTION | PROCEDURE | ROUTINE } routine_name [ ( [ [ argmode ] [ arg_name ] arg_type [, ...] ] ) ] [, ...]
| ALL { FUNCTIONS | PROCEDURES | ROUTINES } IN SCHEMA schema_name [, ...] }
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON LANGUAGE lang_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { { SELECT | UPDATE } [, ...] | ALL [ PRIVILEGES ] }
ON LARGE OBJECT loid [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { { CREATE | USAGE } [, ...] | ALL [ PRIVILEGES ] }
ON SCHEMA schema_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
##连接schema权限,授权cc访问zjy schema权限grant usage on schema zjy to cc;
GRANT { CREATE | ALL [ PRIVILEGES ] }
ON TABLESPACE tablespace_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
GRANT { USAGE | ALL [ PRIVILEGES ] }
ON TYPE type_name [, ...]
TO role_specification [, ...] [ WITH GRANT OPTION ]
where role_specification can be:
[ GROUP ] role_name
| PUBLIC
| CURRENT_USER
| SESSION_USER
GRANT role_name [, ...] TO role_name [, ...] [ WITH ADMIN OPTION ]
##把zjy用户的权限授予用户cc。
grant zjy to cc;
边栏推荐
- 返回一个树形结构数据
- UDP receive queue and multiple initialization test
- File class (add / delete)
- [shutter] shutter debugging (debugging control related functions | breakpoint management | code operation control)
- Internal connection query and external connection
- Unrecognized SSL message, plaintext connection?
- The Sandbox阐释对元宇宙平台的愿景
- Leetcode 183 Customers who never order (2022.07.02)
- Return a tree structure data
- Awk from getting started to being buried (2) understand the built-in variables and the use of variables in awk
猜你喜欢
Job object of collaboration in kotlin
[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)
easyPOI
stm32F407-------IIC通讯协议
Visualisation de l'ensemble de données au format yolov5 (fichier labelme json)
awk从入门到入土(0)awk概述
Create + register sub apps_ Define routes, global routes and sub routes
PyTorch 卷积网络正则化 DropBlock
[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数
[shutter] pull the navigation bar sideways (drawer component | pageview component)
随机推荐
What are the key points often asked in the redis interview
详细些介绍如何通过MQTT协议和华为云物联网进行通信
Apple releases MacOS 11.6.4 update: mainly security fixes
udp接收队列以及多次初始化的测试
CFdiv2-Fixed Point Guessing-(区间答案二分)
Hard core observation 547 large neural network may be beginning to become aware?
Face recognition 6-face_ recognition_ Py based on OpenCV, face detection and real-time tracking using Haar cascade and Dlib Library
Analyzing several common string library functions in C language
Leetcode(540)——有序数组中的单一元素
[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数
[shutter] pull the navigation bar sideways (drawer component | pageview component)
[codeforces] cf1338a - Powered addition [binary]
Anna: Beibei, can you draw?
Internal connection query and external connection
MySQL learning 03
Deep learning notes (constantly updating...)
微信小程序開發工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理問題
Awk from getting started to being buried (2) understand the built-in variables and the use of variables in awk
require. context
[shutter] shutter debugging (debugging control related functions | breakpoint management | code operation control)