Re: [PHP] Reseting the auto-increment number in a MySQL database.

[email protected] (Jim Giner)
Newsgroups php.general
Message-ID <[email protected]>
On 6/26/2013 1:30 PM, Tedd Sperling wrote:
> On Jun 26, 2013, at 1:13 PM, Stuart Dallas <[email protected]> wrote:
>
>> On Wednesday, 26 June 2013 at 18:07, Tedd Sperling wrote:
>>> Hi gang:
>>>
>>> I have a client where their next auto-increment number just jumped from 2300 to 1000000000 for reasons not understood. They want it set back.
>>>
>>> Options such as dropping the primary key and rebuilding the index is NOT possible -- this is a relational table thing.
>>>
>>> So, is there a way (programmatically) to set the next number in an auto-increment?
>>>
>>> Something like:
>>>
>>> alter table abc auto_increment = 2301;
>>>
>>
>> ALTER TABLE tbl AUTO_INCREMENT = 2301;
>>
>> -Stuart
>
> Thanks -- I needed confirmation on that.
>
> It is something that i don't want to do.
>
> Cheers,
>
> tedd
>
> _____________________
> [email protected]
> http://sperling.com
>
But more importantly - don't you need to figure out why it happened?? 
As well as correcting any inserts with the bogus id?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.