根据:2023最新版IDEA创建一个SpringBoot项目 (详细教程)_idea2023创建springboot项目-优快云博客
创建完项目后直接启动项目发现以下报错:
解决方式:检查【application.properties】文件是否写入数据库配置。
spring.application.name=demo
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dmw?createDatabaseIfNotExist=true&autoReconnect=true&default-character-set=utf8&&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
spring.datasource.name=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver