我想在服务器上使用JDBC,但总是失败,这就是我要做的:
春季云版本: Finchley.SR2
spring.profiles.active= jdbc
spring.datasource.url=jdbc:mysql://localhost:3306/config_db
spring.datasource.username=root
spring.datasource.password=12345
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.platform= mysql
spring.cloud.config.server.jdbc.sql= SELECT `key`, `value` FROM `properties` WHERE `application`=? AND `profile`=? AND `label`=?;
spring.cloud.config.server.jdbc.order=0
spring.cloud.config.server.default-profile=production
spring.cloud.config.server.default-label=latest最后,当我启动服务器时,会出现以下错误:
APPLICATION FAILED TO START
Description:
Invalid config server configuration.
Action:
If you are using the git profile, you need to set a Git URI in your configuration. If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.我这里不使用git,为什么这个错误是关于git url的?
发布于 2019-04-29 08:40:16
发布于 2022-03-08 08:46:38
当我试图在启动时删除DataSourceAutoConfiguration.class时,我也遇到了同样的错误。
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
当我刚刚用
@SpringBootApplication
一切都如期而至。
我将该类排除在外的原因是为了在启动时停止自动生成密码。
https://stackoverflow.com/questions/54272460
复制相似问题