1.创建一个springboot项目...................这个太简单了...........需自行创建
2.引入依懒项
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- <version>2.5.5version>
- dependency>
- <dependency>
- <groupId>mysqlgroupId>
- <artifactId>mysql-connector-javaartifactId>
- <version>8.0.26version>
- dependency>
- <dependency>
- <groupId>org.mybatis.spring.bootgroupId>
- <artifactId>mybatis-spring-boot-starterartifactId>
- <version>2.2.0version>
- dependency>
3.在application.yml文件当中进行一个配置
- spring:
- datasource:
- url: jdbc:mysql://localhost:3306/mall_ams?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
- password: root
- username: root
- driver-class-name: com.mysql.cj.jdbc.Driver
4.测试和使用在另外一篇文章了