mysql 配置spring
application.properties:
server.port=8080 server.address=localhost spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.time-zone=Asia/Shanghai #不做限制的参数配置 #默认支持文件上传true spring.servlet.multipart.enabled= true #不做限制-1 spring.servlet.multipart.max-file-size= -1 #不做限制-1 spring.servlet.multipart.max-request-size= -1 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/text?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&useSSL=false spring.datasource.username=root spring.datasource.password=123456 mybatis.type-aliases-package=com.example.pojo mybatis.mapper-locations=classpath:static/*.xml files.upload.path= G:\\spring_boot\\file\\
application.yml:
spring:
datasource:
url: jdbc:mysql://localhost:3306/text?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&useSSL=false
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
/*.yml 遇到的坑
spring:
下面定义的描述必须首行缩进2格
datasource: 这是自动加载的描述文件
再首行缩进2格
username:
*/

浙公网安备 33010602011771号