sharding在application中的配置
1.公共配置
server.port=8080
spring.application.name=sharding
# 驼峰转换
mybatis.configuration.map-underscore-to-camel-case=true
# 打开sharding日志
spring.shardingsphere.props.sql.show=true
# 允许bean覆盖,防止bean和springboot注入冲突
spring.main.allow-bean-definition-overriding=true
# 各日志级别设置
logging.level.root=info
logging.level.org.springframework.web=info
logging.level.com.example.sharding=debug
logging.level.druid.sql=debug
2.水平分表设置
单数据源数据水平分表设置
# 配置多数据源
spring.shardingsphere.datasource.names=m1
spring.shardingsphere.datasource.m1.type=com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.m1.driver-class-name=com.mysql.jdbc.Driver
spring.shardingsphere.datasource.m1.username=root
spring.shardingsphere.datasource.m1.password=12345
spring.shardingsphere.