黑马程序员瑞吉外卖数据库配置

25 阅读1分钟

PixPin_2025-12-05_15-25-27.png PixPin_2025-12-05_15-21-59.png

编辑

在我们的yml文件中URL一定要与数据库中的URL保持一致,注意要进行测试连接,成功后才算配置数据库成功。

spring:
  application:
    name: reggietake
  datasource:
    url: jdbc:mysql://localhost:3306/reggie
    username: root
    password: 123456
    driver-class-name: com.mysql.cj.jdbc.Driver
  sql:
    init:
      mode: never  # 禁用SQL初始化
      continue-on-error: false

mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    map-underscore-to-camel-case: true
  global-config:
    db-config:
      id-type: ASSIGN_ID


aliyun:
  oss:
    endpoint: https://oss-cn-hangzhou.aliyuncs.com
    accessKeyId: LTAI5tP4Y67w4QaQWX3zc4oH
    accessKeySecret: DNA4MT6caay3U81wIelTLgEUPxJz6S
    bucketName: web-tainzi
#spring事务管理日志
logging:
  level:
    org.springframework.jdbc.support.JdbcTransactionManager: debug