springboot项目连接mysql数据库

1.新建springboot项目之后,将application.properties文件改为application.yml
2.在application.yml中编写连接mysql数据库的代码


spring:
  profiles:
    active: dev



---
server:
#port: 8086//项目运行端口号

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/xmgl?useUnicode=true&charaterEncoding=utf8&characterSetResults=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC//连接数据库
    username: root//账户
    password: root//密码
  jpa:
    show-sql: true
    open-in-view: false
  #  profiles: dev
  devtools:
    restart:
      enabled: false
  servlet:
    multipart:
      max-file-size: 35MB
      max-request-size: 100MB
  config:
    activate:
      on-profile: dev
upload: D:/upload/  //文件上传地址





你可能感兴趣的:(springboot,mysql,big,data,数据库)