You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "dingqianwen (via GitHub)" <gi...@apache.org> on 2025/04/14 10:35:51 UTC
[I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
dingqianwen opened a new issue, #35195:
URL: https://github.com/apache/shardingsphere/issues/35195
## org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException
```yml
dataSources:
order:
url: jdbc:mysql://localhost:15432/order
username: root
password: 123456
...
```
There are two databases in the system: db_0 and db_1. The current configuration works fine for querying db_0, but when trying to query db_1, it shows the aforementioned error. In reality, we only need to query one basic table in db_1, but it requires adding another data source for db_1, which occupies too many connections and isn't flexible enough. This issue doesn't exist in version 4+
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "dingqianwen (via GitHub)" <gi...@apache.org>.
dingqianwen commented on issue #35195:
URL: https://github.com/apache/shardingsphere/issues/35195#issuecomment-2801275274
Is there any other way👀
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "dingqianwen (via GitHub)" <gi...@apache.org>.
dingqianwen commented on issue #35195:
URL: https://github.com/apache/shardingsphere/issues/35195#issuecomment-2813334605
> [@dingqianwen](https://github.com/dingqianwen) I noticed that you are using MySQL database. You can register two schemas (as storage units) in the same logical database and load the tables on these two schemas.
>
> For MySQL, the same `host + port + user`, two storage units will reuse the same connection pool (provided that cluster mode is used and registered through DistSQL).
>
> This will not increase the number of connections.
Thank you, I can't use what you said, not just MySQL. All databases need to be considered, so I guess I can only make some changes to the source code to be compatible with my scenario


--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "dingqianwen (via GitHub)" <gi...@apache.org>.
dingqianwen commented on issue #35195:
URL: https://github.com/apache/shardingsphere/issues/35195#issuecomment-2813276795
> > 你好,[@dingqianwen](https://github.com/dingqianwen)您没有提供SQL语句,但我猜您执行了`select xxx from db_1.tableName;`
> > 在ShardingSphere中,`db`在`db.table`被识别为逻辑数据库中,所以会出现您所描述的异常。
> > 目前可行的方案是创建一个新的逻辑数据库,并注册db_1。
>
> 还有其他解决办法吗?这样用太麻烦了
I don't want to establish too many database connections
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #35195:
URL: https://github.com/apache/shardingsphere/issues/35195#issuecomment-2813305787
@dingqianwen
I noticed that you are using MySQL database. You can register two schemas (as storage units) in the same logical database and load the tables on these two schemas.
For MySQL, the same `host + port + user`, two storage units will reuse the same connection pool (provided that cluster mode is used and registered through DistSQL).
This will not increase the number of connections.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "dingqianwen (via GitHub)" <gi...@apache.org>.
dingqianwen commented on issue #35195:
URL: https://github.com/apache/shardingsphere/issues/35195#issuecomment-2813274976
> 你好,[@dingqianwen](https://github.com/dingqianwen) 您没有提供 SQL 语句,但我猜您执行了`select xxx from db_1.tableName;`
>
> 在ShardingSphere中,`db`in`db.table`被识别为逻辑数据库,所以会出现您所描述的异常。
>
> 目前可行的方案是创建一个新的逻辑数据库,并注册db_1。
Is there any other solution? It's too troublesome to use like this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #35195:
URL: https://github.com/apache/shardingsphere/issues/35195#issuecomment-2813263662
Hi, @dingqianwen
You did not provide the SQL statement, but I guess you executed `select xxx from db_1.tableName;`
In ShardingSphere, the `db` in `db.table` is identified as a logic database, so the exception you described occurs.
The current feasible solution is to create a new logic database and register db_1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #35195: org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException
URL: https://github.com/apache/shardingsphere/issues/35195
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] org.apache.shardingsphere.infra.exception.dialect.exception.syntax.database.UnknownDatabaseException [shardingsphere]
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #35195:
URL: https://github.com/apache/shardingsphere/issues/35195#issuecomment-2814212914
> Thank you, I can't use what you said, not just MySQL. All databases need to be considered, so I guess I can only make some changes to the source code to be compatible with my scenario
Limited by the database itself, not all database types can achieve this effect. You can try it yourself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org