Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 459 Bytes

mysql.md

File metadata and controls

16 lines (14 loc) · 459 Bytes

Change Primary Key Value

## Note: auto_increment value must be greater than largest index
ALTER TABLE DATABASE.TABLE auto_increment=9000

Drop All Rows/Reset Primary Key Counter

truncate DATABASE.TABLE 

cli

  • -q - don't buffer output into memory (quick)
  • -r - raw output, don't escape special chars like backslashes
  • -B - use tabs as column separators in output (results in a tsv)
  • -h '<HOSTNAME>' - hostname to use