MySQL数据库不接受ISO字符串,并引发以下异常:
incorrect date value: ‘2019-02-20T10:00:00.000Z’ for column ‘dueDate’ at row 1`.
日期的格式如下:this.state.dueDate.toISOString(),作为ISO字符串.另外,在本地MySQL服务器上,不会引发任何错误.它只会使我的私有Ubuntu服务器失败.
这是表模式:
| tickets | CREATE TABLE `tickets` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`component` int(10) DEFAULT NULL,
`name` varchar(200) CHARACTER SET utf32 COLLATE utf32_romanian_ci DEFAULT NULL,
`description` varchar(2000) CHARACTER SET utf8 COLLATE utf8_romanian_ci DEFAULT NULL,
`startDate` date DEFAULT NULL,
`dueDate` date DEFAULT NULL,
`category` int(10) DEFAULT NULL,
`reporter` varchar(200) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL,
`assignee` varchar(200) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL,
`estimation` float DEFAULT '0',
`priority` varchar(10) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL,
`lane` varchar(15) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL,
`project` int(10) DEFAULT NULL,
`releaseID` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `releaseID` (`releaseID`),
KEY `assignee` (`assignee`),
KEY `reporter` (`reporter`),
KEY `category` (`category`),
KEY `component` (`component`) USING BTREE,
CONSTRAINT `ticket_assignee_null` FOREIGN KEY (`assignee`) REFERENCES `users` (`email`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `ticket_comp_delete` FOREIGN KEY (`component`) REFERENCES `components` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ticket_release_null` FOREIGN KEY (`releaseID`) REFERENCES `releases` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `ticket_reporter_null` FOREIGN KEY (`reporter`) REFERENCES `users` (`email`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `tikcet_category_null` FOREIGN KEY (`category`) REFERENCES `categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 |
尝试更改默认字符集会导致以下错误:
无法更改列“ assignee”:在外键约束“ ticket_assignee_null”中使用
.