MySQL Error 1293 – Incorrect table definition (TIMESTAMP)

提示:Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause MariaDB修改前:CREATE TABLE `about_us` ( `id` int(11) NOT NULL AUTO_INCREMENT, `version_content` varchar(250) DEFAULT NULL, `about_us_desc` tinytext, `contant_us` varchar(280) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=\'关于我们\';方案(1)修改后:CREATE TABLE `about_us` ( `id` int(11) NOT NULL AUTO_INCREMENT, `version_content` varchar(250) DEFAULT NULL, `about_us_desc` tinytext, `contant_us` varchar(280) DEFAULT NULL, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=\'关于我们\';方案(2)修改后:create table `about_us_sec` ( `id` int(11) NOT NULL AUTO_INCREMENT, `version_content` varchar(250) DEFAULT NULL, `about_us_desc` tinytext, `contant_us` varchar(280) DEFAULT NULL, `created_at` timestamp not null default 0, `updated_at` timestamp not null default now(), PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=\'关于我们\';

为TA充电
人已赞赏
wordpress模板

开个office365家庭版的车,明盘50

2020-10-19 2:52:37

wordpress模板

不小心看到了这个

2020-10-19 2:52:48

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
购物车
优惠劵
搜索