
Using WinMySQL Professional
Add primary key

Only accessible when connected and when a table is active, the «Table management>Add primary key» submenu allows a table alteration with a primary key addition. The user who wants to perform this operation must have, at least the «Can ALTER» privilege. Two other conditions are requested to add a primary key to a table : the current table mustn't already have a primary key ; if the current table contains data, the column chosen to receive the primary key mustn't contains duplicate values.
Note : The primary key is extremely important because MySQL® doesn't support the RowID feature yet. This feature allows to distinct two identical lines. So, if you want to make a distinction between two identical lines, you must add a column (see «Table management>Add column» submenu) with a primary key.
How to add a primary key ?
Invoke the «Table management>Add primary key» submenu by clicking on it or using the «Ctrl-F6» shortcut. Then, the «Columns list» screen appears. Select the column on which you wish apply the directive and click on the «Select» button. Then, confirm your choice.