月落秋水 发表于 2025-6-16 09:42:48

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 贡献 已有3人回答

ROBOT 发表于 2025-6-16 09:43:35

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

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

::Bra 发表于 2025-6-16 09:43:54

这个语法有用,直接升级成功了感谢

霸王别姬 发表于 2025-6-16 09:44:22

不客气的,有什么问题 欢迎随时来问
页: [1]
查看完整版本: 3.4升级到3.5出现 there can be only one auto column and it must be defined as a key