Page 1 of 1

ALTER TABLE / AUTO_INCREMENT Don't work?!

PostPosted: 01. October 2013 17:45
by ifiult
Please, I'm using XAMPP 1.8.3 (Windows), and when I run the command

Code: Select all
ALTER TABLE  `users` AUTO_INCREMENT =2;


in MySQL through phpMyAdmin, it shows run successfully but does not execute the command. Why?
Thank you!

Re: ALTER TABLE / AUTO_INCREMENT Don't work?!

PostPosted: 01. October 2013 18:31
by Altrea
ifiult wrote:it shows run successfully but does not execute the command.

How do you check it is not executed?

Re: ALTER TABLE / AUTO_INCREMENT Don't work?!

PostPosted: 01. October 2013 19:33
by ifiult
Please, follow to reproduce the problem:

phpMyAdmin (XAMPP 1.8.3 Windows)

1 - Insert some data in row 1, 2 and 3 (all with "id" column AUTO_INCREMENT)
2 - Delete the row 3
3 - Click on the "Operations" tab and change table options "AUTO_INCREMENT = 4" to "AUTO_INCREMENT = 3" then click "Go". Wait for the message: "Your SQL query has been executed successfully".
4 - Click on the "Browse" tab, and click again to the "Operations" tab.

See that the change was not saved in AUTO_INCREMENT.

Re: ALTER TABLE / AUTO_INCREMENT Don't work?!

PostPosted: 01. October 2013 20:48
by Altrea
Yeah, i see.
That is because auto_increments in INNODB are handled different than these from MyISAM (where decreasing the auto_increment with this command is still working).
So it's an INNODB limitation.

Re: ALTER TABLE / AUTO_INCREMENT Don't work?!

PostPosted: 01. October 2013 21:00
by ifiult
Thank you very much! ;)