running-elephant / datart

Datart is a next generation Data Visualization Open Platform
https://running-elephant.github.io/datart-docs/
Apache License 2.0
2k stars 591 forks source link

添加数据源,有系统库的视图会报错 #1391

Closed mengxlbibibi closed 2 years ago

mengxlbibibi commented 2 years ago

Datart Version The version of datart master 20220512的版本.

Describe the bug 添加数据源的时候,报错如下 [pool-3-thread-1] d.server.service.impl.SourceServiceImpl : source schema sync error java.sql.SQLSyntaxErrorException: SHOW VIEW command denied to user 'root'@'ip' for table 'schema_table_statistics' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1198) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData.extractForeignKeyFromCreateTable(DatabaseMetaData.java:1175) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData$5.forEach(DatabaseMetaData.java:2636) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData$5.forEach(DatabaseMetaData.java:2625) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.IterateBlock.doForAll(IterateBlock.java:56) ~[mysql-connector-java-8.0.23.jar:8.0.23] at com.mysql.cj.jdbc.DatabaseMetaData.getImportedKeys(DatabaseMetaData.java:2674) ~[mysql-connector-java-8.0.23.jar:8.0.23] at datart.data.provider.jdbc.adapters.JdbcDataProviderAdapter.getImportedKeys(JdbcDataProviderAdapter.java:177) ~[classes/:na] at datart.data.provider.jdbc.adapters.JdbcDataProviderAdapter.readTableColumn(JdbcDataProviderAdapter.java:146) ~[classes/:na] at datart.data.provider.JdbcDataProvider.readTableColumns(JdbcDataProvider.java:83) ~[classes/:na] at datart.data.provider.ProviderManager.readTableColumns(ProviderManager.java:97) ~[classes/:na] at datart.server.service.impl.DataProviderServiceImpl.readTableColumns(DataProviderServiceImpl.java:138) ~[classes/:na] at datart.server.job.SchemaSyncJob.execute(SchemaSyncJob.java:94) ~[classes/:na] at datart.server.service.impl.SourceServiceImpl.lambda$updateJdbcSourceSyncJob$2(SourceServiceImpl.java:372) ~[classes/:na]

是因为对sys库的视图schema_table_statistics没有编辑权限,导致报错,从而source_schemas中没有数据,数据视图中这个数据源就没有表结构信息了

navicat选择编辑这个view的时候,也是报错的 image

kiwi-field commented 2 years ago

@scottsut image 报错导致这个页面没有对应的数据源信息

clementchong commented 2 years ago

Looks like DB permission issue

scottsut commented 2 years ago

如果没有权限,就换个有权限的连接账户,我不认为这是 datart 需要解决的问题。

或者你们有什么好建议呢?