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>
相关推荐
Paper_Love33 分钟前
android安全公告网站
android
StarsGreen4 小时前
Android ADB(Android Debug Bridge)命令详解
android
阿健君5 小时前
现代 Android 屏幕适配完全指南
android·kotlin
软件交付观察室6 小时前
用户关掉手机定位权限后,原生App还能显示哪些位置?
android·ios·移动开发
黄林晴6 小时前
Jetpack Compose 1.13.0 来了:大量 API 弃用,表单代码要重构
android·android jetpack
黄林晴6 小时前
Kotlin Toolchain 太牛了!一个提示词就能构建 KMP 双端应用
android·kotlin
黄林晴6 小时前
KMP 跨端共享资源别踩坑!composeResources 看着香,上线容易翻车
android
黄林晴7 小时前
Gradle 9.9.0发布,构建速度提升65%!
android·gradle
黄林晴7 小时前
Android 开了 R8,为什么 SDK 还在阻止优化?
android·google
黄林晴7 小时前
Android CLI 1.1真香:直连 Crashlytics,自助查崩溃、ANR
android·ai编程