If you are using Connector / J's version 8.x, you may notice an attempt to generate MySql information mode (sys, information_schema, performance_schema, etc.) in the table generated code. This may not be what you want! To disable this behavior, set the property "nullCatalogMeansCurrent = true" Add to JDBC
The following is the standard color is easy to miss the 8.0.11 driver,
driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/logistics?useUnicode=true&characterEncoding=utf8
&serverTimezone=GMT&nullCatalogMeansCurrent = true"
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration> <context id="context1"> <!-- 注释构建 --> <commentGenerator> <!-- 去掉所有的注释 --> <property name="suppressAllComments" value="true"/> <property name="suppressDate" value="true"/> </commentGenerator> <!-- 数据库四要素 --> <jdbcConnection connectionURL="jdbc:mysql://localhost:3306/logistics?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT&nullCatalogMeansCurrent = true" driverClass="com.mysql.cj.jdbc.Driver" password="gzsxt" userId="root" /> <!-- 实体类 --> <javaModelGenerator targetPackage="cn.sxt.logistic.pojo" targetProject="mybatis-generator/src" /> <!- sqlMapGenerator<->mapping file targetPackage="cn.sxt.logistic.mapper" targetProject="mybatis-generator/src" /> <!-- ANNOTATEDMAPPER XMLMAPPER --> <!-- 操作接口 --> <javaClientGenerator targetPackage="cn.sxt.logistic.mapper" targetProject="mybatis-generator/src" type="XMLMAPPER" /> <table tableName="user" domainObjectName="User" enableCountByExample="true" enableDeleteByExample="false" enableSelectByExample="true" enableUpdateByExample="false"></table> <table tableName="role" domainObjectName="Role" enableCountByExample="false" enableDeleteByExample="false" enableSelectByExample="true" enableUpdateByExample="false"></table> <table tableName="permission" domainObjectName="Permission" enableCountByExample="false" enableDeleteByExample="false" enableSelectByExample="true" enableUpdateByExample="false"></table> </context> </generatorConfiguration>