0

My table has a AUTO INCREMENT primary key field. In the phpmyadmin homepage when I click on my database, it shows I have 3663 records in my table. But when I opened my table, I found out that serial no (the AUTO INCREMENT field) 3824 is going on.

I had deleted a couple of rows from the table, and since then the problem started. How do I fix the AUTO INCREMENT field now?

  • There is nothing to fix. The value of a generated primary key is meaningless. Gaps are expected and are not a problem. –  Jan 12 '22 at 09:49
  • This is absolutely correct. This must NOT be fixed. If you need in continuous enumeration then add separate column for this purposes. – Akina Jan 12 '22 at 09:49
  • What do you mean @Akina? There will be two primary key fields? –  Jan 12 '22 at 09:50
  • No, the column with continuous enumeration won't be PK. Moreover, it can be not indexed at all. – Akina Jan 12 '22 at 09:52

0 Answers0