GBase 8a集群V95版本grant file报错 Incorrect usage of VC GRANT and GLOBAL PRIVILEGES.

GBase 8a数据库集群,在对数据库用户授权 grant file权限是,和V8一样,grant file除了必须是*.* ,不支持指定库名和表名外,还需要前面加上VC的*。

最终变成

gran file on *.*.* to myUser

请看考V8版本报错

操作场景

用户规划好不同的数据库用户的职责,并给其赋予相应的操作权限,以保证数据库的安全操作。

前提条件

使用GRANT或REVOKE,必须拥有GRANT OPTION权限,并且拥有授予或收回权限。

操作步骤 系统管理员通过GRANT和REVOKE语句为用户授予赋予和回收权限。语法格式请参见GRANT 和REVOKE语句使用。

$ gccli -uroot -p
Enter password: 

GBase client 9.5.2.8.111533. Copyright (c) 2004-2019, GBase.  All Rights Reserved.

gbase> CREATE USER user_general;
Query OK, 0 rows affected

gbase> SET PASSWORD FOR user_general = PASSWORD('H%897_@m');
Query OK, 0 rows affected

对user_general用户只赋予SELECT权限。*.*代表所有数据库的数据库对象,例如:表,视图,存储过程。
gbase> GRANT SELECT ON *.* TO user_general;
Query OK, 0 rows affected

gbase> \q
Bye

使用user_general登录数据库,验证其具备全部权限。存在test数据库和一张t1表,这只是为演示示例提前创建完毕的。
$ gccli -uuser_general -p
Enter password: 

GBase client 9.5.2.8.111533. Copyright (c) 2004-2019, GBase.  All Rights Reserved.

gbase> USE test;
Query OK, 0 rows affected

gbase> UPDATE t1 SET a = 11 WHERE a = 10;
ERROR 1142 (42000): UPDATE command denied to user 'user_general'@'localhost' for table 't1'

gbase> DELETE FROM t1;
ERROR 1142 (42000): DELETE command denied to user 'user_general'@'localhost' for table 't1'

gbase> SELECT * FROM t1;
+------+
| a    |
+------+
|    1 |
|    2 |
|    3 |
|    4 |
|    5 |
|    6 |
|    7 |
|    8 |
|    9 |
|   10 |
+------+
10 rows in set

GBase 8a集群V95版本grant file报错 Incorrect usage of VC GRANT and GLOBAL PRIVILEGES.》有1条评论

评论已关闭。