18 October, 2010

Alter MySQL Field to Become Auto-Incremented Primary Key

It's a small thing, but sometimes you've already created the table and if you're anywhere remotely as forgetful as me then ... AH! Forgot to set the primary key! We can use the ALTER TABLE command thusly to achieve this:

No comments:

Post a Comment