Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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??

Thanks

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

like image 761
EscalinNancy Avatar asked May 30 '12 11:05

EscalinNancy


People also ask

How do I turn off read only in MySQL?

To turn it off, you can use the SET GLOBAL statement as shown below: SET GLOBAL read_only=0; The option should now be turned off.

How do I change a table from read only?

A table can be returned to read and write using the following command: ALTER TABLE READ WRITE; In read-only mode, the following operations are permitted on the table: Select.

How do I edit a data table in MySQL Workbench?

You can add or modify the columns or indexes of a table, change the engine, add foreign keys, or alter the table name. To access the MySQL Table Editor, right-click a table name in the Navigator area of the sidebar with the Schemas secondary tab selected and click Alter Table.


1 Answers

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.

like image 51
Thomas B Avatar answered Oct 15 '22 10:10

Thomas B