472,331 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,331 software developers and data experts.

Reset AUTO_INCREMENT

Hi *

How can reset a auto_incremet collumn so it starts from 1

TIA

Jul 19 '05 #1
2 10135
I came across this same problem in Paul DuBois's excellent book MySQL, pp.
142 - 143. The process is to drop the auto_increment column and then add it
back again:

ALTER TABLE table
DROP column,
ADD column INT UNSIGNED AUTO_INCREMENT NOT NULL,
AUTO_INCREMENT = 1;
"Nico v. Rossum" <n.*********@chello.nl> wrote in message
news:Gx**********************@amsnews03.chello.com ...
Hi *

How can reset a auto_incremet collumn so it starts from 1

TIA

Jul 19 '05 #2
I came across this same problem in Paul DuBois's excellent book MySQL, pp.
142 - 143. The process is to drop the auto_increment column and then add it
back again:

ALTER TABLE table
DROP column,
ADD column INT UNSIGNED AUTO_INCREMENT NOT NULL,
AUTO_INCREMENT = 1;
"Nico v. Rossum" <n.*********@chello.nl> wrote in message
news:Gx**********************@amsnews03.chello.com ...
Hi *

How can reset a auto_incremet collumn so it starts from 1

TIA

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Eric Kincl | last post by:
Hey, I was wondering if it's possible to reset the "auto_increment" feature in MySQL. For example, if I have a database with a list that will...
5
by: Paul Lamonby | last post by:
Hi, i want to create a unique serial number to my Db entries. I thought the best way would be to add the auto_increment primary key value to a...
2
by: Ittay Freiman | last post by:
i cannot set auto_increment to start from anything other than 1: mysql> create table test (id int unsigned not null auto_increment primary key); ...
2
by: Nico v. Rossum | last post by:
Hi *, How can I reset a AUTOINCREMENT column so it starts from 1 to n. TIA
9
by: Bart Van der Donck | last post by:
Hello, The first column of my table is AUTO_INCREMENT. I fill my table with 5 records with a blanco value in their first field. The first...
0
by: Shailesh | last post by:
I made a MyISAM table on mysql 4.0.18 NT with auto_increment column started at 2147483646. The third row I insert fails as expected because the...
2
by: hjyn | last post by:
Hi, how can I add char to auto_increment? For example, the auto_increment is for integer, I want to add a character at the front of that number....
1
by: Phil Latio | last post by:
Newbie questions here... Reading the MySQL manual regarding InnoDB databases, can someone confirm that: 1. if the server is rebooted,...
5
by: akapsycho | last post by:
I've got an index field which stores id numbers which are created by auto_incrementing and assigning that value as the id. ive already emptied out...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.