
相关执行如下: [omm@master2 dn]$ gsql -d postgres -p 15400 gsql ((openGauss 6.0.0 build aee4abd5) compiled at 2024-09-29 18:38:08 commit 0 last mr ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. openGauss=# show enableSeparationOfDuty; enableSeparationOfDuty ------------------------ on (1 row) 1、创建安全管理员 openGauss=# CRAETE USER createrole WITH CREATEROLE password 'xxxxxxxxxxx'; CREATE ROLE openGauss=# \q 2、使用安全管理员登录数据库 [omm@master2 dn]$ gsql -d postgres -p 15400 -U createrole -W '*******'; 3、创建一个用户 openGauss=> CREATE user test password 'xxxxxxxxxxx'; CREATE ROLE 4、修改一个用户提示Permission denied openGauss=> ALTER user test CREATEROLE; ERROR: Permission denied. 5、创建一个角色yf openGauss=> CREATE role yf password 'xxxxxxxxxxx'; CREATE ROLE 6、赋予yf这个角色连接数据库testdb的权限,报错no privileges were granted for "testdb" openGauss=> GRANT CONNECT ON DATABASE testdb to yf; ERROR:no privileges were granted for "testdb". 以上执行有问题的命令,使用初始化用户可以正常执行。 刘司会 18970812136@189.cn