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>
相关推荐
雨白1 小时前
开发 SunnyWeather:Android 天气预报 App(下)
android
AA-代码批发V哥1 小时前
MyBatisPlus之核心注解与配置
mybatis
波波玩转AI1 小时前
MyBatis核心
数据库·mybatis
_extraordinary_2 小时前
Java 字符串常量池 +反射,枚举和lambda表达式
android·java·开发语言
alexhilton2 小时前
学会说不!让你彻底学会Kotlin Flow的取消机制
android·kotlin·android jetpack
来来走走3 小时前
Flutter dart运算符
android·前端·flutter
青小莫3 小时前
IDM下载失败常见原因
android
阿华的代码王国3 小时前
【Android】日期选择器
android·xml·java·前端·后端
小墙程序员5 小时前
Android 性能优化(五)Heap Dump 的使用
android·性能优化
阿华的代码王国5 小时前
【Android】RecyclerView实现新闻列表布局(1)适配器使用相关问题
android·xml·java·前端·后端