记录2个问题,
1.mycat分片后,分表的数据如何存储在同一节点,
以关联表的方式配置,且只配置一次即可,不然会报错
<table name="item" primaryKey="id" dataNode="node_db02,node_db03" rule="rule1" >
<childTable name="itemdetail" joinKey="ietmid" parentKey="id"/>
</table>
2.springboot如何链接mycat
spring.datasource.url=jdbc:mysql://localhost:8066/TESTDB?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&characterEncoding=UTF-8
spring.datasource.username=test
spring.datasource.password=test
spring.datasource.driver-class-name=com.mysql.jdbc.Driver