一、MySQL8.x的连接信息
db.url= jdbc:mysql://localhost:3306/spring_jdbctemplate?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
db.driver=com.mysql.jdbc.Driver
db.username=root
db.password=123456
二、application.yml连接mysql
1 spring:
2 datasource:
3 url: jdbc:mysql://localhost:3306/db20220115_springboot_mybatis?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
4 type: com.alibaba.druid.pool.DruidDataSource
5 username: root
6 password: 123456
7
8 mybatis:
9 mapper-locations: classpath*:/mappers/**/*.xml
10 type-aliases-package: com.moon.springboot.entity
11 configuration:
12 map-underscore-to-camel-case: true
13
14 logging:
15 level:
16 com.moon.springboot.mapper: DEBUG