Cannot determine embedded database driver class for database type NONE

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-11-29 14:26:34.478 ERROR 29736 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
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 (no profiles are currently active).

因为启动springboot时候,会默认使用一个嵌入的数据库驱动,但是需要配置.

我出现报错的原因是没有读取我自己写的配置文件,所以才会出现这样的错误.网上百度的方法挺多的,但是没有找到适合自己的.

引入如下配置在yml文件中:可以正确的读取自己的配置文件:

spring:
  profiles:
    active: zhongguo #这里需要写成你自己的配置文件的名字
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource

 

posted @ 2019-09-19 09:21  King-DA  阅读(287)  评论(0编辑  收藏  举报