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>
相关推荐
宋小黑2 小时前
MyBatis Generator GUI 下载安装教程 可视化MyBatis代码生成
mybatis
似霰3 小时前
Unix Domain Socket —— UDP 篇
android·unix
树码小子3 小时前
Mybatis(13)MyBatis Generator(xml生成器)& Mybatis-Plus初识
xml·mybatis
独自破碎E4 小时前
BISHI54货物堆放
android·java·开发语言
冬奇Lab4 小时前
属性系统与系统配置管理:Android的全局配置中心
android·源码阅读
zjttsh5 小时前
MySQL加减间隔时间函数DATE_ADD和DATE_SUB的详解
android·数据库·mysql
fengsen52113146 小时前
MySQL--》如何在MySQL中打造高效优化索引
android·mysql·adb
吴声子夜歌7 小时前
RxJava——Hot Observable和Cold Observable
android·rxjava
dreams_dream8 小时前
MySQL 主从复制(小白友好 + 企业级)
android·数据库·mysql
城东米粉儿9 小时前
Android PLT Hook 笔记
android