yml 文件连接sql数据库配置
spring:
datasource:
#driver-class-name: com.mysql.cj.jdbc.Driver #驱动注释,采用默认的方式
url: jdbc:mysql://127.0.0.1:3306/jtdb?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
username: root
password: root
1).时区 数据库驱动的高版本需要使用时区操作.
serverTimezone=GMT%2B8 %2B +
2).使用useUnicode=true编码
characterEncoding=utf8 字符采用utf-8编码
3).autoReconnect=true 如果mysql链接断掉之后是否重连.
4).allowMultiQueries=true 是否允许批量操作.

更多推荐

yml 文件连接sql数据库配置