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>
相关推荐
张较瘦_13 分钟前
SpringBoot3 | MyBatis-Plus 搞定宠物管理:从0到1实现增删改查
mybatis·宠物
未知名Android用户29 分钟前
Android动态变化渐变背景
android
nono牛1 小时前
Gatekeeper 的精确定义
android
stevenzqzq3 小时前
android启动初始化和注入理解3
android
城东米粉儿5 小时前
compose 状态提升 笔记
android
粤M温同学5 小时前
Android 实现沉浸式状态栏
android
ljt27249606616 小时前
Compose笔记(六十八)--MutableStateFlow
android·笔记·android jetpack
stevenzqzq6 小时前
Android Studio 断点调试核心技巧总结
android·ide·android studio
沙白猿7 小时前
Redis报错:A bean with that name has already been defined in class path resource
spring boot·redis·mybatis