新版本的PHPMyAdmin禁止我编辑数据 [英] New version of PHPMyAdmin has stopped me being able to edit data
问题描述
PHPMyAdmin刚刚由我的服务器管理员升级到v4.0.4.2.
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只会返回此错误消息:
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?
非常感谢
MySQL v5.1.70
MySQL v5.1.70
编辑/解决方案
EDIT/SOLUTION
我意识到,不一定是要由我创建的新unique column
PHPMyAdmin,而是一个unique index
.这意味着我的表的结构不必更改-我只需要添加一个唯一索引,无论如何我都应该这样做.
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.
推荐答案
没有唯一键,就无法区分两个可以存在的相同记录.因此,phpMyAdmin无法安全地编辑表-您不知道其中的哪些最终会被编辑.您是否真的要在此表中有重复的记录?
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?
这篇关于新版本的PHPMyAdmin禁止我编辑数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!