Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2007
    Posts
    197

    Smile Unanswered: 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?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2007
    Posts
    197

    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

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    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?

  6. #6
    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;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •