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>
相关推荐
七夜zippoe9 分钟前
Python 3.12+ 新特性深度解析:类型系统与性能革命
android·网络·python·类型系统·性能革命·3.12+
Kapaseker12 分钟前
五分钟搞定 Compose 的打字机效果
android·kotlin
彭波39628 分钟前
听歌软件下载!全网音乐随便听!手机电脑+电视端!音乐播放器推荐
android·智能手机·音频·开源软件·娱乐·软件需求
江澎涌33 分钟前
鸿蒙动态导入实战
android·typescript·harmonyos
lifewange35 分钟前
SQL中的聚合函数有哪些
android·数据库·sql
稻草猫.38 分钟前
MyBatis-Plus高效开发全攻略
java·数据库·后端·spring·java-ee·mybatis·mybatis-plus
NPE~1 小时前
[App逆向]环境搭建上篇——抓取apk https包
android·教程·逆向·android逆向·逆向分析
qq_283720051 小时前
MySQL技巧(三):慢查询开启与分析优化案例
android·adb
常利兵1 小时前
从Groovy到KTS:Android Gradle脚本的华丽转身
android
穷人小水滴1 小时前
使用 WebRTC 实现局域网投屏: PC (GNOME ArchLinux) -> 平板 (Android)
android·linux·webrtc·浏览器·js·gnome·投屏