MySQL Workbench Edit Table Data is read only

EscalinNancy picture EscalinNancy · May 30, 2012 · Viewed 174.1k times · Source

When trying Edit Table Data in MySQL Workbench 5.2.37, its in read only mode.

It is editable only if the table has a primary key.

Is there any fix to deal with table without primary key??

Thanks

As one of the suggestion I tried upgrading WB 5.2.40. But still this issue exists.. Could any one Help please..

Answer

Thomas B picture Thomas B · Jul 1, 2012

I'm assuming the table has a primary key. First try to run a unlock tables command to see if that fixes it.

If all else fails you can alter the table to create a new primary key column with auto-increment and that should hopefully fix it. Once you're done you should be able to remove the column without any issues.

As always you want to make a backup before altering tables around. :)

Note: MySQL workbench cannot work without a primary key if that's your issue. However if you have a many to many table you can set both columns as primary keys which will let you edit the data.