MySQL DDL Column Edit is Disabled. Why?

Click For Summary
The discussion centers around an issue with MySQL Workbench where the columns tab for editing tables is disabled. Users suggest that this might be due to the absence of a primary key (PK) in the table, as similar behavior has been noted in phpMyAdmin when a PK is not defined. One user confirms that MySQL Workbench allows adding a PK, while other tools like phpMyAdmin and HeidiSQL do not restrict editing data in the same way. A solution is proposed to create a primary key using DDL (Data Definition Language) commands, with a specific example provided for executing the necessary SQL code to add a primary key in MySQL Workbench.
WWGD
Science Advisor
Homework Helper
Messages
7,771
Reaction score
12,990
Hi All,
I am using MySQL in order to design an ERD (Entity Relation Diagram) , and I can make use of
indexes, triggers, etc. but for some reason, the columns tab , which allows me to add data or just edit the
tables is disabled. I have searched online without success. Any ideas on how to enable it ?
Thanks.
 
Computer science news on Phys.org
WWGD said:
Hi All,
I am using MySQL in order to design an ERD (Entity Relation Diagram) , and I can make use of
indexes, triggers, etc. but for some reason, the columns tab , which allows me to add data or just edit the
tables is disabled. I have searched online without success. Any ideas on how to enable it ?
Thanks.
What client are you using?
 
  • Like
Likes WWGD
Do you have an pkey defined for the table?
I've noticed similar behavior in phpMyAdmin when a pKey hasn't been specified.
 
  • Like
Likes WWGD
Samy_A said:
What client are you using?
Sorry, it is MySQL workbench. @cpscdave : I cannot even get to the point of choosing a PK for the table
 
Last edited:
cpscdave said:
Do you have an pkey defined for the table?
I've noticed similar behavior in phpMyAdmin when a pKey hasn't been specified.
Good catch.
WWGD said:
Sorry, it is MySQL workbench.
I tried it with a table with no PK. MySQL Workbench doesn't let me edit table data. phMyAdmin and HeidiSQL do let me edit table data.
 
Samy_A said:
Good catch.

I tried it with a table with no PK. MySQL Workbench doesn't let me edit table data. phMyAdmin and HeidiSQL do let me edit table data.

Maybe there is a setting in phpMyAdmin that disables this. I don't have any other admin tools installed currently so can't try them out :)
 
cpscdave said:
Maybe there is a setting in phpMyAdmin that disables this. I don't have any other admin tools installed currently so can't try them out :)
Thanks for your advice, cpscdave, but I cannot even get to choose a PK for the table.
 
WWGD said:
Thanks for your advice, cpscdave, but I cannot even get to choose a PK for the table.
My MySQL Workbench is friendlier, and let's me add the PK.

Can you execute the DDL code to create the PK?
 
Samy_A said:
My MySQL Workbench is friendlier, and let's me add the PK.

Can you execute the DDL code to create the PK?
Thanks, Samy_A, never done it before, could you please suggest a ref for how to do it? I know how to use DDL in general to create and populate (insert values into) tables, but I have never done it in MySQL workbench.
 
  • #10
WWGD said:
Thanks, Samy_A, never done it before, could you please suggest a ref for how to do it? I know how to use DDL in general to create and populate (insert values into) table, but I have never done it in MySQL workbench.
Enter the code in a SQL panel:
SQL:
ALTER TABLE `test`.`nokey` 
CHANGE COLUMN `Column 1` `Column 1` INT(11) NOT NULL 
, ADD PRIMARY KEY (`Column 1`) ;
Click on the button with the lightning to execute the statement.
 
  • Like
Likes WWGD

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
4
Views
3K
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K