The CREATE TABLE ` accounting ` (
Id INT the NOT NULL AUTO_INCREMENT,
` trandate ` char (8) the NOT NULL DEFAULT ',
` uid ` varchar (20) NOT NULL DEFAULT ',
` terminal ` varchar (20) DEFAULT NULL,
` client_ip ` varchar (16) NOT NULL DEFAULT ',
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
PARTITION BY RANGE (to_days (trandate)) (
PARTITION p201409 VALUES LESS THAN (to_days (' 2014-10-01 ')),
PARTITION p201410 VALUES LESS THAN (to_days (' 2014-11-01 ')),
PARTITION p201411 VALUES LESS THAN (to_days (' 2014-12-01 '));
But this statement has been built the table failed, don't know why, please help each master, thank you!
CodePudding user response:
I there is no MYSQL environment, so can't execute your script,Can remove the all to_days function try,
CodePudding user response:
Two places error1
Id INT the NOT NULL AUTO_INCREMENT,
A primary key defined with primary key
Correct term
Id INT the NOT NULL AUTO_INCREMENT primary key ,
the second sentence
` client_ip ` varchar (16) NOT NULL DEFAULT ',
This more than a ", "number