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>
相关推荐
阿巴斯甜34 分钟前
2026小知识点(9)
android
古月-一个C++方向的小白2 小时前
MySQL数据库——数据类型
android·数据库·mysql
张小潇3 小时前
AOSP15 WMS/AMS系统开发 - WindowManagerService finishDraw与prepareSurface流程详解
android
Java成神之路-4 小时前
面试题:MyBatis延迟加载的底层原理
mybatis
帅次6 小时前
Modifier 链与顺序、测量与命中区域
android·kotlin·compose·modifier
leory6 小时前
请详细描述Handler消息机制的工作原理
android·面试
leory6 小时前
请描述Binder IPC的基本原理和工作流程
android·面试
leory6 小时前
View的事件分发机制是怎样的?dispatchTouchEvent、onInterceptTouchEvent、onTouchEvent的关系?
android·面试
敖正炀6 小时前
Spring Boot + MyBatis 企业级数据访问层实战:从选型到分库分表的深度演进
mybatis
zander2587 小时前
Canal本地部署保姆级教程
android