1、官方给出了解决办法,jdbc连接新增nullCatalogMeansCurrent属性
在配置文件中GeneratorMapper.xml中,通过添加这个属性解决这种问题,代码就按照上面图中的示例就可以了
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/db?useUnicode=true&characterEncoding=utf-8"
userId="root" password="root">
<property name="nullCatalogMeansCurrent" value="true" />
</jdbcConnection>