New version of PHPMyAdmin has stopped me being abl

2019-01-26 09:12发布

PHPMyAdmin has just been upgraded by my server admin to v4.0.4.2.

Now I am unable to edit rows in the following table:

CREATE TABLE IF NOT EXISTS `product_options` (
  `product_id` int(10) NOT NULL,
  `option_id` int(10) NOT NULL,
  KEY `product_id` (`product_id`,`option_id`)
)

PHPMyAdmin just returns this error message when I browse data in the table:

This table does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available.

I don't want a unique column in this table, so how can I edit data? Is there a setting I can change?

Many thanks

MySQL v5.1.70

EDIT/SOLUTION

I realised that it wasn't necessarily a new unique column PHPMyAdmin was wanting me to create, but instead a unique index. This means that the structure of my tables didn't have to change - I just had to add a unique index, which I should have been doing anyway.

7条回答
仙女界的扛把子
2楼-- · 2019-01-26 09:38

I found a solution which might help someone in future, I had table with id, which was not primary key and not auto increment, i added temp column, made it primary and auto increment, then i edited the id column and then i removed the temp column, after that i changed id to primary and auto increment

查看更多
Animai°情兽
3楼-- · 2019-01-26 09:38

I had the same issue. In my own case I already had an id column. I dropped the column and recreated it; this time I made it a primary key and ticked A_I (ie Auto-Increment). Everything went fine.

Note: You can only do this if changing your IDs does not affect your work.

查看更多
走好不送
4楼-- · 2019-01-26 09:40

Without unique key, there is no way to differentiate between two same records which can exists. Therefore phpMyAdmin can not safely edit the table - you have no clue which of these would end up edited. Do you really want to have duplicate records in this table?

查看更多
姐就是有狂的资本
5楼-- · 2019-01-26 09:43

All you got to do is add a unique column like one called id with a index = PRIMARY like the pic, or if you have one already that is called id that are numbers just make it PRIMARY

enter image description here

查看更多
趁早两清
6楼-- · 2019-01-26 09:43

You can just add a field that name is "id", and check A_I option.

查看更多
我欲成王,谁敢阻挡
7楼-- · 2019-01-26 09:44

In my experience, you have more than 2 primary keys or you don't have any primary key.

查看更多
登录 后发表回答