Mysql primary key after creating and using a database
.. I created a database .. used it for quite a while without a primary key .. ( I had a uniq field set as an index ) .. but .. I now need a primary key ..
Feel free to use your favorite cli/webbased mysql interface
ALTER TABLE `table_name` ADD `field_name` INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY(`field_name`);
Using PhpMyAdmin to do this was a problem because it wouldn't want to do both at the same time .. and you can't set one and expect the other one to work .. :)