关于Mybatis错误

 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2021-04-12 15:26:14.344 ERROR 8428 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :

 


APPLICATION FAILED TO START


 

Description:

 

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

 

Reason: Failed to determine a suitable driver class

 

 

Action:

 

Consider the following:

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

 

 

Process finished with exit code 0

 

如上,mybatils启动时出现此错误,是因为数据库连接未配置,需在配置文件中加入如下内容即可

 

 

 

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

spring.datasource.url=jdbc:mysql://106.15.203.9:3306/acgn_soul_dev?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true

spring.datasource.username=root

spring.datasource.password=Megumi@mysql

posted @ 2021-07-22 20:15  daoyih  阅读(109)  评论(0)    收藏  举报