环境 idea2019.2  jdk1.8   数据库mysql 5.7

项目 结构

SpringBoot2.2.2版本自动建表

 

new ->Project  使用springboot快速搭建web项目        选好sdk  next

SpringBoot2.2.2版本自动建表

填写项目信息   next

SpringBoot2.2.2版本自动建表

 点Web-->勾选 Spring Web  

SpringBoot2.2.2版本自动建表

点SQL->勾选 JDBC API     和   MySQL  Driver

SpringBoot2.2.2版本自动建表

 确认最后的项目信息 Finish   篇幅太长 点开看           这个例子只是生成了表       最后的例子中有数据生成 

创建下面两个配置文件   放在resource目录下

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/jdbc?useSSL=true&serverTimezone=UTC&characterEncoding=UTF8
    data-username: root
    data-password: root
    initialization-mode: always
    schema=classpath: schema.sql
application.yml

相关文章:

  • 2021-08-09
  • 2021-11-01
  • 2022-12-23
  • 2022-02-18
  • 2021-08-22
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-09
  • 2021-12-20
  • 2021-08-11
  • 2021-11-23
  • 2021-07-29
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案