Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql change the column id to start from 1 and auto increment from there

I was looking at my table in phpmyadmin and noticed that the id starts at 13410 and increase by 1. I would like to reset and start from one. I've read many people say its better to leave it alone or its going to get complicated if you messed with it but I still need a solution to at least start the id at 1. Thanks

like image 631
merrill Avatar asked Nov 15 '11 09:11

merrill


1 Answers

ALTER TABLE table AUTO_INCREMENT = 1

http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html

I hope you know what you do!

like image 166
MatTheCat Avatar answered Sep 20 '22 16:09

MatTheCat