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>
相关推荐
Lei活在当下5 小时前
Codex 工程化实践指南:深入理解 AGENTS.md、SKILL.md 与 MCP
android·openai·ai编程
修炼者6 小时前
Toast的显示流程
android
Java程序之猿6 小时前
SpringBoot + camel+IBM MQ实现消息队列处理
java·spring boot·mybatis
simplepeng8 小时前
Room 3.0 KMP Alpha-01
android·kotlin·android jetpack
Lei活在当下9 小时前
Windows 下 Codex 高效工作流最佳实践
android·openai·ai编程
fatiaozhang95279 小时前
基于slimBOXtv 9.19.0 v4(通刷晶晨S905L3A/L3AB芯片)ATV-安卓9-完美版线刷固件包
android·电视盒子·刷机固件·机顶盒刷机·晶晨s905l3ab·晶晨s905l3a
私房菜10 小时前
Selinux 及在Android 的使用详解
android·selinux·sepolicy
一只特立独行的Yang10 小时前
Android中的系统级共享库
android
两个人的幸福online11 小时前
php开发者 需要 协程吗
android·开发语言·php
修炼者12 小时前
WindowManager(WMS)构建全局悬浮窗
android