MyCat主键自增功能配置指南.pdfVIP

  • 0
  • 0
  • 约小于1千字
  • 约 2页
  • 2026-06-09 发布于北京
  • 举报

主键自增功能开启

1.在server.xml中,将sequnceHandlerType设置为12.在schema.xml中,在table中

增加属性autoIncrement值为true(默认为false)3.依赖全局序列(请参看全局序列

支持,数据库或本地文件),增加序列,与table名称相同且大写,例如customer的序

列名为CUSTOMER4.执行insertintocustomer(name,companyid,shardingid)__

values(test,2,10000);5.暂不支持主键为null,例如:insertintocustomer(id,

name,companyid,shardingid)values(null,test,2,10000);__

主键自增功能开启

1.server.xml中,sequnceHandlerType设置为1

2.schema.xml中,table中增加属性autoIncrement值为true默认为false

3.依赖全局序列(请参看全局序列支持,数据库或本地文件),增加序列,与table名称同

名大写,如customer序列名为CUSTOMER

4.执行insertintocustomer(name,company_id

文档评论(0)

1亿VIP精品文档

相关文档