Skip to content

Instantly share code, notes, and snippets.

@kernusr
Created Oct 11, 2021
Embed
What would you like to do?
Двигаем auto_increment в mysql

Посмотреть текущее значение AUTO_INCREMENT

SELECT `AUTO_INCREMENT`
FROM  INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'db_name'
  AND   TABLE_NAME   = 'table_name';

Поменять текущее значение AUTO_INCREMENT

ALTER TABLE 'table_name' AUTO_INCREMENT = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment