環境介紹:
mysql8
generatorConfig.xml
配置文件:
<table tableName="%">
<generatedKey column="id" sqlStatement="Mysql" identity="true"/>
</table>
配置後運行mybatisGenerate
插件,會生成很多文件,其中有些並不是在自己指定的數據庫中,名稱很奇怪,好像是把mysql所有表都給處理了一遍
解決方法:
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="jdbc:mysql://localhost/***"
userId="***" password="*****">
<property name="nullCatalogMeansCurrent" value="true" />
</jdbcConnection>
加粗傾斜的語句是關鍵
參考資料:
http://www.mybatis.org/generator/usage/mysql.html