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>
相关推荐
kymjs张涛18 分钟前
零一开源|前沿技术周报 #7
android·前端·ios
wuwu_q2 小时前
RK3566/RK3568 Android11 修改selinux模式
android·rk3568
不像程序员的程序媛2 小时前
redis的一些疑问
java·redis·mybatis
_一条咸鱼_3 小时前
Android Runtime内存共享与访问控制原理剖析(71)
android·面试·android jetpack
嘉小华3 小时前
第三章:焦点分发全链路源码解析
android
嘉小华3 小时前
Android 协程全景式深度解析:第六章 高阶并发模式
android
嘉小华3 小时前
Android 协程全景式深度解析:第七章 协程调试与性能优化
android
你过来啊你3 小时前
Android开发中RxJava的使用与原理
android
你过来啊你4 小时前
Android Glide使用与底层机制详解
android
血舞之境4 小时前
Android 模块打包成aar遇到的空指针的问题
android