Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在本地主机中使用 wamp 服务器。我在 MySQL 中有一个带有“ID”名称的自动增量字段。清空表格内容后,ID 的值从旧值继续。我试图在清空表后将此字段的起始值重置为 1。我怎么能做到这一点?
你应该截断你的表。
TRUNCATE `[Your_table_name]`;
截断表自动将自动增量值重置为 0。
TRUNCATE TABLE table_name;