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>
相关推荐
2501_9160088921 分钟前
iOS 性能测试的深度实战方法 构建从底层指标到真实场景回放的多工具测试体系
android·ios·小程序·https·uni-app·iphone·webview
w***954922 分钟前
SQL美化器:sql-beautify安装与配置完全指南
android·前端·后端
r***12381 小时前
若依微服务中配置 MySQL + DM 多数据源
android·mysql·微服务
ALex_zry2 小时前
MySQL连接数管理与优化实操经验分享
android·mysql·adb
90后小陈老师2 小时前
用户管理系统 05 实现后端注册功能 | Java新手实战 | 最小架构 | 期末实训 | Java+SpringBoot+Vue3
java·开发语言·spring boot·后端·spring·maven·mybatis
apigfly3 小时前
深入Android系统(十三)Android的窗口系统
android·设计模式·源码
k***85843 小时前
【SpringBoot】【log】 自定义logback日志配置
android·前端·后端
S***q1923 小时前
Kotlin内联函数优化
android·开发语言·kotlin
小墙程序员3 小时前
在Android中,kotlin 的一些开发技巧(二)
android·kotlin
曾经的三心草3 小时前
JavaEE初阶-多线程1
android·java·java-ee