mybatis generator 表名多了个点

csdn有一个,要收费,研究后原因如下,是 mysql不支持 SQL catalogs and schema, 解决方式就是去掉 这两个字段,同时在jdbcConnection中设置nullCatalogMeansCurrent属性为true。 手册如下

MySql does not properly support SQL catalogs and schema. If you run the create schema command in MySql, it actually creates a database - and the JDBC driver reports it back as a catalog. But MySql syntax does not support the standard catalog..table SQL syntax.

For this reason, it is best to not specify either catalog or schema in generator configurations. Just specify table names and specify the database in the JDBC URL.

If you are using version 8.x of Connector/J you may notice that the generator attempts to generate code for tables in the MySql information schemas (sys, information_schema, performance_schema, etc.) This is probably not what you want! To disable this behavior, add the property "nullCatalogMeansCurrent=true" to your JDBC URL.

For example:

复制代码
    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/my_schema"
            userId="my_user" password="my_password">
        <property name="nullCatalogMeansCurrent" value="true" />
    </jdbcConnection>
相关推荐
MegaDataFlowers1 分钟前
MybatisPlus入门案例
mybatis
limuyang21 小时前
在 Android 上用上原生的 xxHash,性能直接拉满
android
Fate_I_C2 小时前
ViewModel 的生命周期与数据保持
android·kotlin
凛_Lin~~2 小时前
安卓实现textview跑马灯效果
android·java
Fate_I_C2 小时前
Kotlin函数一
android·开发语言·kotlin
cheems95272 小时前
[Mybatis] #{ } 与 ${ } 的底层博弈与工程实践
mybatis
我讲个笑话你可别哭啊3 小时前
Android Studio无线调试连接安卓设备
android·ide·android studio
pengyu3 小时前
【Kotlin 协程修仙录 · 炼气境 · 初阶】 | 感受天地灵气,写出第一个挂起函数
android·kotlin
林栩link3 小时前
Android CLI 与 Skills:提升 AI Coding 效率
android
AI玫瑰助手3 小时前
Python基础:列表的定义、增删改查核心操作
android·开发语言·python