springboot (2.0以上)连接mysql配置

pom

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
</dependency>

application.properties

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/yourdatabase?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC
spring.datasource.username=username
spring.datasource.password=password
posted @ 2020-01-08 15:04  芋头猪爸爸  阅读(882)  评论(0编辑  收藏  举报
我的主页