Nexy Posted June 6, 2008 Share Posted June 6, 2008 Is there any way to reset a primary key to a certain number, so it auto-increments starting from the number you set? Not by code, but by phpmyadmin. Thank You! Link to comment https://forums.phpfreaks.com/topic/108938-solved-reset-primary-key/ Share on other sites More sharing options...
Barand Posted June 6, 2008 Share Posted June 6, 2008 AUTO_INCREMENT The initial AUTO_INCREMENT value for the table. In MySQL 5.0, this works for MyISAM and MEMORY tables. It is also supported for InnoDB as of MySQL 5.0.3. To set the first auto-increment value for engines that do not support the AUTO_INCREMENT table option, insert a “dummy” row with a value one less than the desired value after creating the table, and then delete the dummy row. For engines that support the AUTO_INCREMENT table option in CREATE TABLE statements, you can also use ALTER TABLE tbl_name AUTO_INCREMENT = N to reset the AUTO_INCREMENT value. The value cannot be set lower than the maximum value currently in the column. http://dev.mysql.com/doc/refman/5.0/en/create-table.html Link to comment https://forums.phpfreaks.com/topic/108938-solved-reset-primary-key/#findComment-558986 Share on other sites More sharing options...
Nexy Posted June 6, 2008 Author Share Posted June 6, 2008 Thank You! Link to comment https://forums.phpfreaks.com/topic/108938-solved-reset-primary-key/#findComment-559261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.