• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

cokelike

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

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:
 */

 

posted on 2022-06-02 12:01  cokelike  阅读(803)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3