1. 配置文件 server: port: 8080 spring: datasource: username: root password: password #url中database为对应的数据库名称 url: jdbc:mysql://localhost:3306/mysql?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 driver-class-name: com.mysql.cj.jdbc.Driver mybatis: mapper-locations: classpath*:mapper/**/*Mapper.xml type-aliases-package: org.llf.**.** #showSql logging: level: com.example.demo.mapper: debug
2. 启动类