1

我正在尝试删除表中的所有数据行并重置自动增量。当我这样做时,我收到以下消息:

Unexpected number of rows removed!

One row was not removed. Reload the table to be sure that the contents
have not changed in the meantime. Check the Console for possible errors 
inside the primary keys of this table!

更新 当我执行 TRUNCATE TABLE 'users' 时,我收到此消息

    Cannot truncate a table referenced in a foreign key constraint
 (`marketing`.`designer_application`, CONSTRAINT
 `designer_application_user_id_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES 
`marketing`.`users` (`id`))
4

1 回答 1

1

在您能够删除它们之前,可能有另一个进程对您选择的相同行进行了操作。如果您使用 UI 删除行,请考虑改用 SQL 查询。使用TRUNCATE将清除表格的内容并将其重置auto increment0.

TRUNCATE TABLE `tablename`;
于 2015-10-30T06:01:25.080 回答