spring:无法为数据库类型none确定嵌入式数据库驱动程序类

yrefmtwq  于 2021-06-25  发布在  Mysql
关注(0)|答案(1)|浏览(416)

我想用活动配置文件'firza'运行我的项目,但它给了我以下错误。在谷歌上搜索之后,我尝试了所有可能的修复方法,但都没有成功:有人能帮我吗?
应用程序属性

spring.datasource.url=jdbc:mysql://localhost:3306/MySportsAcademy?createDatabaseIfNotExist=true
spring.datasource.username=admin
spring.datasource.password=ivl123
spring.data.rest.basePath=/api

# spring.profiles.active=firza

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect=com.ivl.MySportsAcademy.dbconfig.MySportsAcademyMysql57Dialect
spring.jpa.hibernate.ddl-auto=update
allowed.origins=http://localhost:9000
logging.level.org.springframework.security=DEBUG
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
logging.level.org.apache.tomcat.jdbc.pool=DEBUG
logging.level.com.reservos=DEBUG
logging.level.com.sendgrid=DEBUG
logging.level.org.hibernate.tool.hbm2ddl=debug
server.port=3000

应用程序-firza.properties

spring.datasource.url=jdbc:mysql://localhost:3306/MySportsAcademy?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=admin
spring.data.rest.basePath=/api

spring.jpa.hibernate.ddl-auto=update
allowed.origins=http://localhost:9000
logging.level.org.springframework.security=DEBUG
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.apache.tomcat.jdbc.pool=DEBUG
logging.level.com.reservos=DEBUG
logging.level.com.sendgrid=DEBUG
logging.level.org.hibernate.tool.hbm2ddl=debug
server.port=3000
admin.email.id=bilal.raza@indusvalleylabs.com

pom.xml文件

<dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

错误


***************************

APPLICATION FAILED TO START

***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (the profiles "firza" are currently active).
polhcujo

polhcujo1#

确保资源文件夹中的application.properties具有所需的数据库参数
这是一个例子

spring.datasource.platform=mysql
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://vaquarkhan.com:3307/vk01?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=xyz
spring.datasource.password=xyzwe
spring.datasource.initialization-mode=never

# spring.datasource.schema=schema.sql

logging.level.org.springframework.integration=DEBUG

相关问题