1、问题描述
Activiti启动初始化报错:
Caused by: java.sql.SQLSyntaxErrorException: Table 'study_activiti.act_ge_property' doesn't exist
2、问题原因
出现这种问题的原因是mysql版本问题,mysql8.xxx以上驱动会出现这个问题,我的mysql配置,是8.0.26的。
因为mysql使用schema标识库名而不是catalog,因此mysql会扫描所有的库来找表,如果其他库中有相同名称的表,activiti就以为找到了,本质上这个表在当前数据库中并不存在。
设置nullCatalogMeansCurrent=true,表示mysql默认当前数据库操作,在mysql-connector-java 5.xxx该参数默认为true,在6.xxx以上默认为false,因此需要设置nullCatalogMeansCurrent=true。
3、解决方案
设置nullCatalogMeansCurrent=true