新版SpringBoot-Spring-Mybatis 数据库相关配置
application.properties
server.port=8081 # ========================数据库相关配置===================== spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/online_ybclass?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai spring.datasource.username=root spring.datasource.password=root # 使用阿里巴巴druid数据源,默认使用自带 # spring.datasource.type=com.alibaba.druid.pool.DruidDataSource #开启控制台打印sql mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl # mybatis 下划线转驼峰配置,两者都可以 # mybatis.configuration.mapUnderscoreToCamelCase=true mybatis.configuration.map-underscore-to-camel-case=true # 配置扫描 mybatis.mapper-locations=classpath:mapper/*.xml #配置xml的结果别名 mybatis.type-aliases-package=net.ybclass.online_ybclass.domain
注意事项