Commit 4796ab44 authored by 耿迪迪's avatar 耿迪迪

多数据源

parent 4b08e119
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
<version>3.4.3.4</version> <version>3.4.3.4</version>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.4.1</version>
</dependency>
<!-- 其他可能需要的依赖 --> <!-- 其他可能需要的依赖 -->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
......
#mysql #mysql
spring: spring:
datasource: datasource:
username: zh-mes-device-db dynamic:
password: KJThfp2x85YMmGAw primary: device #设置默认的数据源或者数据源组,默认值即为master
url: jdbc:mysql://36.138.180.82:3309/zh-mes-device-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
driver-class-name: com.mysql.jdbc.Driver datasource:
\ No newline at end of file device:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://36.138.180.82:3309/zh-mes-device-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: zh-mes-device-db
password: KJThfp2x85YMmGAw
mes:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://36.138.180.82:3309/zh_mes_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
username: zh_mes_db
password: Dba5CdmBm3tdJ4ph
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment