0

I have a column name of index_rows that starts at 1 instead of 0. Is there a way to have the index start 0? For example, row 0, row 1, row 3, etc...

  • in pypmyadmin you can choose a table, click operations and manually set the auto increment value. If your table is empty, setting to 0 might be ok. Why do you want to do this anyhow? – Kai Qing Dec 19 '14 at 18:13
  • I have a table that skip a row index, example, 172, 174, 175. Some how it skipped row 173.. – Bruce Walker Dec 19 '14 at 18:15
  • Check if the selected answer in [here](http://stackoverflow.com/questions/16232430/i-want-id-to-start-from-0-but-starts-from-1) is what you were looking for. – Willz Dec 19 '14 at 18:16
  • mysql doesn't skip auto increment primary keys. If there's a gap it's because that row was deleted. Why would it be a problem though? – Kai Qing Dec 19 '14 at 18:17
  • I must have deleted a row. I can't have skip row index. How can I reassign the index.. – Bruce Walker Dec 19 '14 at 18:19
  • "*I can't have skip row index*" - yes you can. If you are relying on gapless numbers you are misunderstanding and misusing automatically generated primary keys. –  Dec 20 '14 at 10:12

1 Answers1

0

phpMyAdmin > Choose your table > Operations

You can set AUTO_INCREMENT value there.

If you delete a row and insert new values into your table, your new rows will get new unique values. It's not a bug, not a problem. They are auto_incremented values but they don't have to follow each other in a perfect order like 1,2,3,4,5,6,7...

salep
  • 1,332
  • 9
  • 44
  • 93