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

多数据源

parent 4b08e119
......@@ -46,6 +46,12 @@
<version>3.4.3.4</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.4.1</version>
</dependency>
<!-- 其他可能需要的依赖 -->
<dependency>
<groupId>org.projectlombok</groupId>
......
#mysql
spring:
datasource:
username: zh-mes-device-db
password: KJThfp2x85YMmGAw
url: jdbc:mysql://36.138.180.82:3309/zh-mes-device-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
driver-class-name: com.mysql.jdbc.Driver
\ No newline at end of file
dynamic:
primary: device #设置默认的数据源或者数据源组,默认值即为master
strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
datasource:
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