Discuz!小编 发表于 2024-11-6 02:39:58

3.4升级到3.5出现 there can be only one auto column and it must be defined as a key

在转换主题分表pre_forum_post_1表的时候出现

(1075) Incorrect table definition; there can be only one auto column and it must be defined as a keyALTER TABLE forum_post_1 ENGINE=InnoDB;

查看表结构

position字段有个
AUTO_INCREMENT值如图,但是这个值在pre_forum_post也是有的,转换后会自动删除这值。而分表pre_forum_post_1直接提示错误。




我知道答案 回答被采纳将会获得1 贡献 已有2人回答

Sylvia 发表于 2024-11-6 02:40:27

ALTER TABLE `pre_forum_post_1` CHANGE `position` `position` INT(8) UNSIGNED NOT NULL;

执行一下这个sql语句 ,然后刷新升级页面 ,继续升级就可以了

海军大都督 发表于 2024-11-6 02:40:37

这个语法有用,直接升级成功了感谢
页: [1]
查看完整版本: 3.4升级到3.5出现 there can be only one auto column and it must be defined as a key