You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by Eric <et...@gmail.com> on 2019/09/07 16:41:56 UTC
Create table returns error cannot find table rule
Hi,
I tried following statement, it returned an error "Cannot find table rule
and default data source with logic table: 'test1'". I think ShardingSphere
route DDL statement to all database instances by default?
Please help.
create table test1 (
field1 varchar(40));
Best Regards,
Eric Poon
Re: Create table returns error cannot find table rule
Posted by Juan Pan <pa...@apache.org>.
Yes, you’re right. The sharding rule is prerequisite before you execute any
SQL.
---------------------------------
Juan Pan (Trista)
Apache ShardingSphere
Eric <et...@gmail.com> 于2019年9月9日周一 上午5:53写道:
> Hi Juan,
>
> Thank you.
>
> I think that makes sense because rules are need for the routing even though
> the table can be created. Which means the rule has to be setup before
> creating tables.
>
> Regards,
> Eric Poon
>
Re: Create table returns error cannot find table rule
Posted by Eric <et...@gmail.com>.
Hi Juan,
Thank you.
I think that makes sense because rules are need for the routing even though
the table can be created. Which means the rule has to be setup before
creating tables.
Regards,
Eric Poon
Re: Create table returns error cannot find table rule
Posted by juan pan <pa...@apache.org>.
Hi, Eric.
DDL SQL will be routed to all the databases configured in setting file,
please notice, not just all the instances.
But the first thing is that you need to create a Sharding rule to tell
ShardingSphere which databases tables are created.
---------------------------------
Juan Pan (Trista)
Apache ShardingSphere
Eric <et...@gmail.com> 于2019年9月8日周日 上午12:42写道:
> Hi,
>
> I tried following statement, it returned an error "Cannot find table rule
> and default data source with logic table: 'test1'". I think ShardingSphere
> route DDL statement to all database instances by default?
>
> Please help.
>
> create table test1 (
> field1 varchar(40));
>
> Best Regards,
> Eric Poon
>