分区表主键不包含分区键报错ERROR 1105 (HY000)
ERROR 1105 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
MySQL里面主键及唯一索引都需要包含分区键,否则均会报错
CREATE TABLE `sample` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`trade_no` varchar(32) NOT NULL COMMENT 'xxx',
`trade_type` varchar(32) DEFAULT NULL COMMENT 'xxx',
`sub_trade_type` varchar(32) DEFAULT NULL COMMENT 'xxx',
`request_no` varchar(64) NOT NULL COMMENT 'xxx',
`request_date` date not null DEFAULT '2000-01-01' COMMENT 'xxx',
`product_code` varchar(32) DEFAULT NULL COMMENT 'xxx',
`trade_channel` varchar(16) DEFAULT NULL COMMENT 'xxx',
`trade_status` varchar(32) NOT NULL COMMENT 'xxx',
`revoke_flag` varchar(8) DEFAULT NULL COMMENT 'xxx',
`cancel_flag` varchar(8) DEFAULT NULL COMMENT 'xxx',
`original_trade_no` varchar(32) DEFAULT NULL COMMENT 'xxx',
`trade_finished_date` date DEFAULT NULL COMMENT 'xxx',
`pay_finish_date` date DEFAULT NULL COMMENT 'xxx',
`ccy` varchar(3) NOT NULL COMMENT 'xxx',
`trade_amt` bigint(16) NOT NULL COMMENT 'xxx',
`discount_amt` bigint(16) DEFAULT NULL COMMENT 'xxx',
`discount_info` varchar(256) DEFAULT NULL COMMENT 'xxx',
`pay_amt` bigint(16) DEFAULT NULL COMMENT 'xxx',
`billing_contract_no` bigint(20) not null DEFAULT 0 COMMENT 'xxx',
`billing_login_name` varchar(32) DEFAULT NULL COMMENT 'xxx',
`transfer_contract_no` varchar(16) DEFAULT NULL COMMENT 'xxx',
`transfer_login_name` varchar(32) DEFAULT NULL COMMENT 'xxx',
`transfer_flag` varchar(16) DEFAULT NULL COMMENT 'xxx',
`merchant_no` varchar(32) DEFAULT NULL COMMENT 'xxx',
`merchant_trade_no` varchar(32) DEFAULT NULL COMMENT 'xxx',
`merchant_name` varchar(256) DEFAULT NULL COMMENT 'xxx',
`goods_info` varchar(32) DEFAULT NULL COMMENT 'xxx',
`memo` varchar(256) DEFAULT NULL COMMENT 'xxx',
`created_at` date NOT NULL COMMENT 'xxx',
`created_by` varchar(32) NOT NULL COMMENT 'xxx',
`updated_at` date NOT NULL COMMENT 'xxx',
`updated_by` varchar(32) NOT NULL COMMENT 'xxx',
PRIMARY KEY (id,request_date)
) ENGINE=InnoDB AUTO_INCREMENT=5731 DEFAULT CHARSET=utf8 COMMENT='xxx'
partition by range (year(request_date)*100+month(request_date)) (
partition p201604 values less than (201604),
partition p201605 values less than (201605),
partition p201606 values less than (201606),
partition p201607 values less than (201607),
partition p201608 values less than (201608),
partition p201609 values less than (201609),
partition p201610 values less than (201610),
partition p201611 values less than (201611),
partition p201612 values less than (201612),
partition p201701 values less than (201701),
partition p201702 values less than (201702),
partition p201703 values less than (201703),
partition p201704 values less than (201704),
partition p201705 values less than (201705),
partition p201706 values less than (201706),
partition p201707 values less than (201707),
partition p201708 values less than (201708),
partition p201709 values less than (201709),
partition p201710 values less than (201710),
partition p201711 values less than (201711),
partition p201712 values less than (201712),
partition p201801 values less than (201801),
partition p201802 values less than (201802),
partition p201803 values less than (201803),
partition p201804 values less than (201804),
partition p201805 values less than (201805),
partition p201806 values less than (201806),
partition p201807 values less than (201807),
partition p201808 values less than (201808),
partition p201809 values less than (201809),
partition p201810 values less than (201810),
partition p201811 values less than (201811),
partition p201812 values less than (201812));
分区表主键不包含分区键报错ERROR 1105 (HY000)的更多相关文章
- mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
注:本文来源于< mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy r ...
- mysql-创建用户报错ERROR 1396 (HY000): Operation CREATE USER failed for 'XXXX'@'XXXX'
创建用户: create user 'test'@'%' identified by 'test'; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...
- MySQL报错ERROR 1558 (HY000): Column count of mysql.user is wrong.
MySQL报错ERROR 1558 (HY000): Column count of mysql.user is wrong. 1.今天在使用MySQL创建数据库时出现如下报错: mysql> ...
- 解决MySQL报错ERROR 2002 (HY000)【转】
今天在为新的业务线搭架数据库后,在启动的时候报错 root@qsbilldatahis-db01:/usr/local/mysql/bin# ./mysql ERROR 2002 (HY000): C ...
- 第一次登录mysql,使用任何命令都报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
问题: 使用临时密码登录成功后,使用任何myql命令,例如show databases;都提示下面的报错 ERROR 1820 (HY000): You must reset your passwor ...
- mysql-创建用户报错ERROR 1396 (HY000): Operation CREATE USER failed for 'XXXX'@'XXXX'(转载)
创建用户: create user ‘test’@’%’ identified by ‘test’; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...
- MySQL5.7 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement
MySQL5.7 报错 : ERROR 1820 (HY000): You must reset your password using ALTER USER statement before exe ...
- mysql-创建用户报错ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'
创建用户: create user ‘test’@’%’ identified by ‘test’; 显示ERROR 1396 (HY000): Operation CREATE USER faile ...
- MySQL报错ERROR 1436 (HY000): Thread stack overrun:
今天搭私服的时候,卡在角色创建画面,日志报错如上. 这是MySQL报错ERROR 1436 (HY000): Thread stack overrun: 修改方法 vim /etc/my.cnf ...
随机推荐
- xml转Map,对象,Map转xml,inputs tram 转xml 字符串的工具类方法
众所周知,大家在微信开发工程中,由于微信开发文档中,对于消息的接收发送都是基础xml数据的(太坑了),所以我们需要对XML进行解析转换: 1.我们先引入所需要的依赖 dom4j (解析xml的),xs ...
- docker搭建lnmp(一)
因为安装过程中涉及到一些修改配置文件的步骤,由于刚尝试不太会,所以这里都是通过安装好后,进入容器修改配置,最后退出重启容器. 目录结构 docker ├── mysql │ └── dockerf ...
- js去除字符串空格(空白符)
使用js去除字符串内所带有空格,有以下三种方法: ( 1 ) replace正则匹配方法 去除字符串内所有的空格:str = str.replace(/\s*/g,""); 去除字 ...
- C# Convert.ToInt32和int.Parse转换null和空字符串时的不同表现
Convert.ToInt32最终调用的函数见下图: int.Parse调用的函数见下图: 具体的见https://www.cnblogs.com/leolis/p/3968943.html的博客,说 ...
- iOS.Book.Mac OS X and iOS Internals: To the Apple’s Core
深入解析Mac OS X & iOS操作系统 http://product.china-pub.com/3769686
- Codeforces559C Gerald and Giant Chess
一道计数类\(DP\) 原题链接 我们可以先计算从左上角到右下角总的路径,再减去经过黑色方格的路径即是答案. 总路径数可以用组合数直接计算:\(C_{H+W-2}^{H-1}\) 因为从左上角到右下角 ...
- dede 栏目及子栏目
结果如图: <ul class="bottom_ul"> {dede:channelartlist } <li><a href="{dede ...
- synchronized Lock
synchronized和Lock都是Java语言提供的两种实现对共享资源进行同步的机制.其中synchronized使用Object对象本身的wait().notify().notifyAll()方 ...
- String、StringBuffer、StringBuilder和StringTokenizer的区别
1)String.StringBuffer.StringBuilder都用于字符串操作,其中,String是不可变类,即String对象一旦被创建,其值不能被修改,而StringBuffer和Stri ...
- pytho常用模块2——random
random模块用来生成随机数,有以下几个常用方法: import random random.random() #产生随机数[0-1) random.randint(a,b) #产生随机整数[a,b ...