List:General Discussion« Previous MessageNext Message »
From:Angela liu Date:October 3 2011 11:21pm
Subject:Re: How MyISAM handle auto_increment
View as plain text  
Thanks, what about if mysqld restart, does auto_increment gets reset  ? 

I saw this happened to Innodb, if table is empty and server restart, auto_incremnet gets
reset to 0

From: mos <mos99@stripped>
To: mysql@stripped
Sent: Monday, October 3, 2011 3:01 PM
Subject: Re: How  MyISAM handle auto_increment

At 04:46 PM 10/3/2011, you wrote:
> Hi, Folks: I have questions regarding how MyISAM handles auto_increment clolumn? 1.
is there a auto_increment counter for MyISAM to assign a new value to auto_increment


>   2. if MyISAM has the counter, is the counter stored in memory or disk? Thnaks

It is stored with the table definition.  It is only reset to 0 when the table is
(re)created. You can get the last AutoInc for the record that was just added by "Select
Last_Insert_Id()". See


-- MySQL General Mailing List
For list archives:
To unsubscribe:
How MyISAM handle auto_incrementAngela liu3 Oct
  • Re: How MyISAM handle auto_incrementReindl Harald3 Oct
    • Re: How MyISAM handle auto_incrementLucio Chiappetti5 Oct
  • Re: How MyISAM handle auto_incrementmos4 Oct
  • Re: How MyISAM handle auto_incrementAngela liu4 Oct
    • Re: How MyISAM handle auto_incrementmos4 Oct
RE: How MyISAM handle auto_incrementLucio Chiappetti6 Oct
  • RE: How MyISAM handle auto_incrementJerry Schwartz7 Oct