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>
相关推荐
梦里花开知多少4 分钟前
深入理解Android binder线程模型
android·架构
千里马学框架12 分钟前
aospc/c++的native 模块VScode和Clion
android·开发语言·c++·vscode·安卓framework开发·clion·车载开发
洞见不一样的自己25 分钟前
深度解析Kotlin泛型:从基础到实战
android
luanma15098026 分钟前
Laravel3.x:PHP框架的里程碑
android
Kapaseker1 小时前
Kotlin 精讲 — companion object
android·kotlin
studyForMokey1 小时前
【Android面试】打包 & 启动专题
android·面试·职场和发展
zh_xuan2 小时前
Android Jetpack 使用Room数据库
android·android jetpack·room
斯密码赛我是美女2 小时前
周报--2
android·数据库
zhangren024682 小时前
Laravel9.x核心特性全解析
android