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>
相关推荐
计蒙不吃鱼40 分钟前
一篇文章实现Android图片拼接并保存至相册
android·java·前端
LucianaiB1 小时前
如何做好一份优秀的技术文档:专业指南与最佳实践
android·java·数据库
duwei_wang6 小时前
[Android]-Admob配置过多导致的慢消息
android
雨白7 小时前
发送自定义广播
android
BillKu7 小时前
Java + Spring Boot + Mybatis 插入数据后,获取自增 id 的方法
java·tomcat·mybatis
雨白8 小时前
深入理解广播机制 (BroadcastReceiver)
android
烙印60110 小时前
MyBatis原理剖析(二)
java·数据库·mybatis
婵鸣空啼12 小时前
GD图像处理与SESSiON
android
sunly_13 小时前
Flutter:导航固定背景图,滚动时导航颜色渐变
android·javascript·flutter
用户20187928316713 小时前
简单了解android.permission.MEDIA_CONTENT_CONTROL权限
android