Issue
I got more errors when I export my table from Mysql Workbench6.3 and insert into my database by using Phpmyadmin.
CREATE TABLE IF NOT EXISTS `loan`.`tb_banks` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`bank_name` VARCHAR(100) CHARACTER SET 'utf8' NOT NULL,
`account_name` VARCHAR(100) CHARACTER SET 'utf8' NOT NULL,
`account_number` VARCHAR(100) CHARACTER SET 'utf8' NOT NULL,
`active` TINYINT(4) NOT NULL DEFAULT '1',
`user_id` INT(11) NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
CONSTRAINT `banks.user_id = users.id`
FOREIGN KEY (`user_id`)
REFERENCES `loan`.`tb_users` (`id`)
ON DELETE CASCADE
ON UPDATE CASCADE)
ENGINE = InnoDB
AUTO_INCREMENT = 31
DEFAULT CHARACTER SET = utf8;
SHOW WARNINGS;
CREATE INDEX `banks_user_id_index` ON `loan`.`tb_banks` (`user_id` ASC);
SHOW WARNINGS;
Solution
MySQL does not accept TIMESTAMP values that include a zero in the day or month column or values that are not a valid date. The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.
More about this here : http://dev.mysql.com/doc/refman/5.7/en/datetime.html
Answered By - Andreea Dumitru
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.