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>
相关推荐
cike_y4 小时前
Mybatis之解析配置优化
java·开发语言·tomcat·mybatis·安全开发
00后程序员张7 小时前
python 抓包在实际项目中的合理位置,结合代理抓包、设备侧抓包与数据流分析
android·ios·小程序·https·uni-app·iphone·webview
勇往直前plus7 小时前
MyBatis/MyBatis-Plus类型转换器深度解析:从基础原理到自定义实践
数据库·oracle·mybatis
灵感菇_8 小时前
Android Service全面解析
android·service·四大组件
古城小栈8 小时前
Spring Boot 数据持久化:MyBatis-Plus 分库分表实战指南
spring boot·后端·mybatis
无名-CODING8 小时前
SQL 注入指南
sql·mybatis
alexhilton8 小时前
Jetpack ViewModel内幕:内部机制与跨平台设计
android·kotlin·android jetpack
_李小白11 小时前
【Android FrameWork】延伸阅读: Android应用安装过程
android
光头闪亮亮11 小时前
Android手持机扫码出入库的开发详解-6.APP下载更新
android
光头闪亮亮11 小时前
Android手持机扫码出入库的开发详解-7.SQLite CRUD操作
android