ERROR 1064(42000):Values value must be of same type as partition function near').....
报错很明显了。
msyql对日期分区,还没有细化到每天的24小时(因为不是连续的),你可以参考如下按照天数的比较连续的分区:
create table user (id int(11) NOT NULL AUTO_INCREMENT,
name varchar(255),
birthday date default NULL,
PRIMARY KEY (id,birthday)) engine=innodb
partition by range (to_days(birthday))
(PARTITION p0 VALUES LESS THAN (to_days('1985-01-01')),
PARTITION p1 VALUES LESS THAN (to_days('2004-01-01')),
PARTITION p2 VALUES LESS THAN (to_days('2005-01-01')),
PARTITION p3 VALUES LESS THAN (to_days('2006-01-01')),
PARTITION p4 VALUES LESS THAN (to_days('2007-01-01')),
PARTITION p5 VALUES LESS THAN (to_days('2010-01-01')),
PARTITION p6 VALUES LESS THAN MAXVALUE);