Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    4

    Unanswered: Alter AUTO_INCREMENT value....

    Hiya Guru's!

    I'm quite new to MySQL, that's why I have a question about the AUTO_INCREMENT function.

    Can you tell me what the syntax is to change the value of an AUTO_INCREMENT column? I get this error when I type the following:
    ALTER TABLE `blah` SET AUTO_INCREMENT = 175

    I am missing something here and the manual doesn't tell me what command to use. Let's hope you can help me. Thanks!

  2. #2
    Join Date
    Jun 2003
    Posts
    9
    insert a dummy row

    lets say auto increment column is id

    insert into TBL (id) values (174);

    next time u do a normal insert the auto inc column will bet set to 175

    u can delete the dummy row at any time after its insert

  3. #3
    Join Date
    Dec 2008
    Posts
    1

    Wink

    Quote Originally Posted by acwibier
    I get this error when I type the following:
    ALTER TABLE `blah` SET AUTO_INCREMENT = 175
    You don't need "SET"...

    All you need to do is...
    Code:
    ALTER TABLE `blah` AUTO_INCREMENT = 175
    Hope this helps!!


    ----------------------
    Alex J. Fierro
    Alex Fierro Web Design

Posting Permissions

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