OceanBase Developer Center

在使用ODC初次连接到数据库后,用户遇到权限不足的问题,无法查询表结构。具体表现为BadSqlGrammarException,错误源于SQLSyntaxErrorException,提示SELECT命令被拒绝。解决方法是为当前用户授予Oceanbase数据库的只读权限。
摘要由CSDN通过智能技术生成

在初次使用ODC,连接成功后,无法查询数据库表结构:权限不够!

预期外异常,错误详情:Unhandled exception, type=BadSqlGrammarException, message=PreparedStatementCallback; bad SQL grammar [select t.part_level, case when t.part_func_type = 0 then 'HASH' when t.part_func_type = 1 then 'KEY' when t.part_func_type = 2 then 'KEY' when t.part_func_type = 3 then 'RANGE' when t.part_func_type = 4 then 'RANGE COLUMNS' when t.part_func_type = 5 then 'LIST' when t.part_func_type = 6 then 'KEY' when t.part_func_type = 7 then 'LIST COLUMNS' when t.part_func_type = 8 then 'HASH' when t.part_func_type = 9 then 'KEY' when t.part_func_type = 10 then 'KEY' else 'UNKNOWN' end as partition_method, t.part_func_expr, t.part_num, case when t.sub_part_func_type = 0 then 'HASH' when t.sub_part_func_type = 1 then 'KEY' when t.sub_part_func_type = 2 then 'KEY' when t.sub_part_func_type = 3 then 'RANGE' when t.sub_part_func_type = 4 then 'RANGE COLUMNS' when t.sub_part_func_type = 5 then 'LIST' when t.sub_part_func_type = 6 then 'KEY' when t.sub_part_func_type = 7 then 'LIST COLUMNS' when t.sub_part_func_type = 8 then 'HASH' when t.sub_part_func_type = 9 then 'KEY' when t.sub_part_func_type = 10 then 'KEY' else 'UNKNOWN' end as subpartition_method, t.sub_part_func_expr, t.sub_part_num, '1' as is_sub_part_template, p.part_id, p.part_name, p.high_bound_val from oceanbase.__all_database d, oceanbase.__all_table_v2 t, oceanbase.__all_part p where d.database_name = ? and t.table_name = ? and d.tenant_id = t.tenant_id and d.database_id = t.database_id and t.tenant_id = p.tenant_id and t.table_id = p.table_id order by part_id asc]; nested exception is java.sql.SQLSyntaxErrorException: (conn=1674201) SELECT command denied to user 'kanban'@'%' for table '__all_database'
额外给当前用户赋予对oceanbase数据库的只读权限

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值