Skip to content

Instantly share code, notes, and snippets.

@richard512
Last active May 27, 2018 02:25
Show Gist options
  • Save richard512/13da5d86940b204b4f39ea0d1a6372d5 to your computer and use it in GitHub Desktop.
Save richard512/13da5d86940b204b4f39ea0d1a6372d5 to your computer and use it in GitHub Desktop.
MySQL Add Auto-Increment Primary Key Column (Unsigned BIGINT) to existing MySQL Table -- Useful when you want a unique identifier for each column
ALTER TABLE `tablename` ADD COLUMN id BIGINT UNSIGNED AUTO_INCREMENT, ADD PRIMARY KEY `id` (`id`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment