spring-boot集成mysql

2017-12-05 19:37:49来源:CSDN作者:zhaoyahui_666人点击

分享

1、注入mysql依赖

<dependency>            <groupId>mysql</groupId>            <artifactId>mysql-connector-java</artifactId>            <version>5.1.35</version>        </dependency>
2、在application.properties中添加mysql源

spring.datasource.driver-class-name= com.mysql.jdbc.Driver #驱动spring.datasource.url= jdbc:mysql://127.0.0.1:3306/mysql?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true  #mysql源路径spring.datasource.username= admin  #账号spring.datasource.password= admin  #密码


微信扫一扫

第七城市微信公众平台