If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > auto increment in mysql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-10-08, 03:15
ankur02018 ankur02018 is offline
Registered User
 
Join Date: Jun 2007
Posts: 189
Smile auto increment in mysql

I want primary key coloum should start with 10000 and every time it increments with 1

so I changed auto_increment_increment=1
and auto_increment_offset=10000

but still when i create a table in database primary key starts with 1

does mysql support the autoincrement feature if YES then please suggest HOW?
Reply With Quote
  #2 (permalink)  
Old 06-10-08, 06:24
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
according to da manual, you have to be on at least version 5.0.2

http://dev.mysql.com/doc/refman/5.0/...ment-increment
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 06-10-08, 09:53
ankur02018 ankur02018 is offline
Registered User
 
Join Date: Jun 2007
Posts: 189
Smile

Quote:
Originally Posted by r937
according to da manual, you have to be on at least version 5.0.2

http://dev.mysql.com/doc/refman/5.0/...ment-increment
my mysql version is 5.0.27
operating system is windows XP

still is there any more requirement
Reply With Quote
  #4 (permalink)  
Old 06-10-08, 10:25
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
have you tried the simple queries they show on that page?

i'm not on version 5 yet so i can't test it for you
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 06-10-08, 11:25
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
Why don't you provide a simple example that proves it's not working and we can then try and guess the reason. If we can't guess then I could try your code on an XP machine later.

Did you follow Rudy's advice and try the simple examples?
Why do you want the offset to start at 10000?
Reply With Quote
  #6 (permalink)  
Old 06-11-08, 03:36
topcat2 topcat2 is offline
Registered User
 
Join Date: Jun 2008
Posts: 7
You can use the following CREATE TABLE syntax:

create table table_name (id integer not null auto_increment, value integer, primary key (id)) auto_increment=10000;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On