猿问

错误信息“com.mysql.cj.exceptions.WrongArgument

我正在使用 MySQL 数据库开发一个 Spring Boot 项目。如果我运行我的代码,一个WrongArgumentException说法是databaseURL cannot be null.


application.properties:


spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.datasource.jdbc-url=jdbc:mysql//localhost:3306/reserving?autoReconnect=true&useSSL=false

spring.datasource.username=root

spring.datasource.password=****


##Mapper Config##

mybatis.type-aliases-package=com.springboot.reserving

mybatis.mapper-locations=mapper/**/*.xml


spring.devtools.livereload.enabled =true


spring.freemarker.cache=false

错误信息:


java.sql.SQLNonTransientConnectionException: Cannot load connection class

 because of underlying exception: 

com.mysql.cj.exceptions.WrongArgumentException: The database URL cannot be null.


天涯尽头无女友
浏览 150回答 2
2回答

三国纷争

将属性更改spring.datasource.jdbc-url为spring.datasource.url=jdbc:mysql//localhost:3306/reserving?autoReconnect=true&useSSL=false

HUH函数

应用程序属性spring.datasource.jdbc-url中没有命名的属性改变spring.datasource.jdbc-url到spring.datasource.urlspring.datasource.platform=mysqlspring.datasource.url=jdbc:mysql//localhost:3306/reserving?autoReconnect=true&useSSL=false spring.datasource.username=rootspring.datasource.password=****spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
随时随地看视频慕课网APP

相关分类

Java
我要回答