异常2

Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP……
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT'注册时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录更新时间',
数据库的版本问题,只能有一个timestamp,改成datetime
然后继续报错

Invalid default value for 'create_time'
解决:将上面的该为下面的
`create_time` datetime DEFAULT NULL COMMENT'注册时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录更新时间',

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.2.RELEASE:
repackage (repackage) on project edu-user:
Execution repackage of goal org.springframework.boot:
spring-boot-maven-plugin:2.2.2.RELEASE:repackage failed: Unable to find main class
有一个模块没有main方法

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'cn.blb.ad.mapper.PromotionAdMapper' available:
expected at least 1 bean which qualifies as autowire candidate.
在主类上加上@MapperScan("cn.blb.ad.mapper")

Failed to configure a DataSource:
'url' attribute is not specified and no embedded datasource could
数据源重新配置

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).

在主启动类上添加@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

 

posted @ 2022-05-18 08:48  时光里的少年  阅读(36)  评论(0)    收藏  举报