1.将resources文件夹里面的application文件修改为 application.yml文件,在里面添加内容:
spring:
datasource:
username: root
password: lytcreate
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/demo?characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
2.修改pom.xml文件在 dependencies里面增加:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.23</version>
</dependency>
3.使用maven更新依赖
4.更新