17:52:38.252 [main] ERROR org.springframework.boot.SpringApplication -- Application run failed
org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here
in 'reader', line 8, column 8:
url: jdbc:mysql://localhost:3306/ch ...
^
原本代码:
server:
port: 8080
#数据库配置
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
url:jdbc:mysql://localhost:3306/online_program_application?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&allowPublicKeyRetrieval=true
#配置Mybatis实体和xml映射
mybatis:
mapper-locations: classpath:mapper/*.xml
type-alias-package: com.li.online_program_system.entity
解决:url:后面未空格
修改后代码:
server:
port: 8080
#数据库配置
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
url: jdbc:mysql://localhost:3306/online_program_application?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&allowPublicKeyRetrieval=true
#配置Mybatis实体和xml映射
mybatis:
mapper-locations: classpath:mapper/*.xml
type-alias-package: com.li.online_program_system.entity