views:

45

answers:

3

Hello,

I've removed the primary key of one table of my MySQL database, but now, when I use the MySQL Administrator and try to edit some data of this table, it doesn't allow me to do this.

The button edit that appears in the bottom of the table keeps visible, but disabled to click.

+1  A: 

That's likely because it doesn't know which row you want to have the update applied to, since without a primary key identifier it could match multiple lines.

Eduardo
+1  A: 

The "edit" button in MySQL Administrator will use the primary key to determine the query to run. For example - UPDATE some_field FROM some_table WHERE id = uid; If you'd like to continue using the "edit" button, you'll have to add back a primary key. If a primary key is not appropriate you can also update your rows using the UPDATE query.

thetaiko
A: 

Try this:

alter table tableX add primary key(id);

Replace id with your primary key column(s).

ceteras