Reputation: 463
CREATE TABLE IF NOT EXISTS `xyz` (
`id` INT(11) NOT NULL AUTO_INCREMENT ,
`start_time` TIMESTAMP NOT NULL,
`end_time` TIMESTAMP NOT NULL,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
Running the above mysql script results in: Error Code: 1067. Invalid default value for 'start_time'. The error is most likely due to two TIMESTAMP column in one table
Similar answer to this question is vague. Invalid default value for 'create_date' timestamp field
I need a clear solution.
Upvotes: 0
Views: 255
Reputation: 12378
You've missed backticks `
before xyz
:
CREATE TABLE IF NOT EXISTS `xyz` (
`id` INT(11) NOT NULL AUTO_INCREMENT ,
`start_time` TIMESTAMP NOT NULL,
`end_time` TIMESTAMP NOT NULL,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
Upvotes: 1