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>
相关推荐
冬奇Lab5 小时前
PMS核心机制:应用安装与包管理深度解析
android·源码阅读
城东米粉儿7 小时前
Android 计算滑动帧率 笔记
android
城东米粉儿8 小时前
Android Choreographer 和 looper 结合使用 监控
android
城东米粉儿8 小时前
Android inline Hook 笔记
android
城东米粉儿8 小时前
Android 防止 Printer 覆盖笔记
android
疯狂敲代码的老刘12 小时前
MyBatis Generator GUI 下载安装教程 可视化MyBatis代码生成
java·mybatis·mybatis-ui
Android系统攻城狮12 小时前
Android tinyalsa深度解析之pcm_get_timestamp调用流程与实战(一百一十八)
android·pcm·tinyalsa·android hal·audio hal
yuezhilangniao14 小时前
win10环境变量完全指南:Java、Maven、Android、Flutter -含我的环境备份
android·java·maven
山北雨夜漫步15 小时前
点评day02 商户缓存
缓存·mybatis