5fdc1f3ade4e68965.jpg_fo742.jpg

application.yml

# 端口
server:
  port: 8080

spring:
  application:
    # 应用名称
    name: test1
  profiles:
    # 使用的配置文件
    active: prod

application-dev.yml

  datasource:
    primary:
      jdbc-url: jdbc:mysql://localhost:3306/dbname
      #url: jdbc:mysql://localhost:3306/dbname
      username: root
      password: 123456
      driver-class-name: com.mysql.jdbc.Driver

application-prod.yml

  datasource:
    primary:
      jdbc-url: jdbc:mysql://192.168.0.2:3306/dbname
      #url: jdbc:mysql://192.168.0.2:3306/dbname
      username: root
      password: 12345678
      driver-class-name: com.mysql.jdbc.Driver

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code