2
的默認值表錯誤,當我在創建一個表phpMyAdmin的,我收到此錯誤:MySQL的:創建枚舉
#1067 - Invalid default value for 'htmlstate'
查詢創建表:
CREATE TABLE `cms_article` (
`contentid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pagetext` mediumtext /*!40101 COLLATE latin1_bin */ NOT NULL,
`threadid` int(10) unsigned DEFAULT NULL,
`blogid` int(10) unsigned DEFAULT NULL,
`posttitle` varchar(255) /*!40101 COLLATE latin1_bin */ DEFAULT NULL,
`postauthor` varchar(100) /*!40101 COLLATE latin1_bin */ DEFAULT NULL,
`poststarter` int(10) unsigned DEFAULT NULL,
`blogpostid` int(10) unsigned DEFAULT NULL,
`postid` int(10) unsigned DEFAULT NULL,
`post_posted` int(10) unsigned DEFAULT NULL,
`post_started` int(10) unsigned DEFAULT NULL,
`previewtext` varchar(2048) /*!40101 COLLATE latin1_bin */ DEFAULT NULL,
`previewimage` varchar(256) /*!40101 COLLATE latin1_bin */ DEFAULT NULL,
`imagewidth` int(10) unsigned DEFAULT NULL,
`imageheight` int(10) unsigned DEFAULT NULL,
`previewvideo` mediumtext /*!40101 COLLATE latin1_bin */,
`htmlstate` enum('off','on','on_nl2br') /*!40101 COLLATE latin1_bin */ NOT NULL DEFAULT 'off',
PRIMARY KEY (`contentid`)
) ENGINE=InnoDB AUTO_INCREMENT=503 /*!40101 DEFAULT CHARSET=latin1 */ /*!40101 COLLATE=latin1_bin */;
mysql服務器版本? – Jigar
這適用於SQL小提琴版本5.5。 。 。 http://www.sqlfiddle.com/#!2/afbbd4。 –
這也適用於MySQL服務器版本5.6.24和phpMyAdmin 4.4.6.1 – Jigar