Search code examples
mysqlmysql-workbench

MySQL Workbench Edit Table Data is read only


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?

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


Solution

  • 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.