GBase 8a 导出时报错FileSystem Error : Permission denied

GBase 8a数据库集群提供select into outfile方式导出数据到文件,由于数据库进程运行在dbaUser,一般都是操作系统gbase用户,所以简单的本地导出的目录,需要gbase用户的写入权限。如果无权限则报FileSystem Error : Permission denied错误。

目录导航

样例

由于操作系统gbase用户没有权限写入/opt目录,所以报错。

gbase> select * from t1;
+------+-------+
| id   | value |
+------+-------+
|    1 |   234 |
+------+-------+
1 row in set (Elapsed: 00:00:00.00)

gbase> select * from t1 into outfile '/opt/t1.txt' fields terminated by ',';
ERROR 1708 (HY000): [10.0.2.107:5050](GBA-02AD-0005)Failed to query in gnode:
DETAIL: (GBA-01EX-700) Gbase general error: Export operation failed with error - FileSystem Error : Permission denied, File name /opt/t1.txt
SQL: SELECT /*::ffff:10.0.2.107_208_4_2020-09-04_10:49:01*/ /*+ TID('2556298') */ `_tmp_1795293194_208_t32_1_1599174116_s`.`c1` AS `id`, `_tmp_1795293194_208_t32_1_1599174116_s`.`c2` AS `value` INTO OUTFILE '/opt/t1.txt'  CHARSET utf8 outfilemode by local  writemode by normal  FIELDS  TERMINATED BY ','  ENCLOSE
gbase>

解决

请参考完全相似的报错