Unsupported Screen Size: The viewport size is too small for the theme to render properly.

How To Reset Auto_increment Field To 1?

forums forums SQLyog Using SQLyog How To Reset Auto_increment Field To 1?

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #9206
      GreenAlien
      Member

      Is there a way to reset an auto_increment field to 0 via the sqlyog interface? i.e. without having to manually issue a SQL command.

      I can clear the table's data but it doesnt reset the auto_increment field (this is expected behaviour), but it would be nice to have a non-default tickbox option to reset the auto_increment to 1 when i select the “Empty Table” option (consider that a feature request maybe?).

      I did some poking around but I can't find a menu option to do this.

      This would be just a convenience thing. In the meantime the following SQL works fine.

      alter table auto_increment = 0;

      Cheers, Ant

    • #19118
      peterlaursen
      Participant

      There is no functionality for this is SQLyog. It also is a little dangerous if the autoincr-field is referenced!

      You can do as you do, or you can drop the autoincrement-column and create it again. Then rows will be re-numbered

      Lots of discussions on the matter here:

      http://dev.mysql.com/doc/mysql/en/example-…-increment.html

Viewing 1 reply thread
  • You must be logged in to reply to this topic.