简体   繁体   English

mysql 表在 phpMyAdmin 中不可编辑(没有主键?)

[英]mysql Table not editable in phpMyAdmin (no primary key?)

I googled quite a bit but am still not sure what's the problem with my current staging project where I've imported a live database.我在谷歌上搜索了很多,但仍然不确定我当前导入实时数据库的暂存项目有什么问题。

I have a staging url (plesk environment) where I usually run subdomain.myserver.com and create a Database for it.我有一个临时 url(plesk 环境),我通常在其中运行 subdomain.myserver.com 并为其创建一个数据库。 I import the database of the live site and run searchreplacedb script over it to alter the tables accordinlgy to my staging url.我导入实时站点的数据库并在其上运行 searchreplacedb 脚本以根据我的登台 url 更改表。

However for this project - and this has not happend to me before – I can't edit table contents inside of phpMyAdmin.但是对于这个项目 - 这在我之前没有发生过 - 我无法在 phpMyAdmin 中编辑表格内容。 Even thouhgh I've set up everything like usual and it normally shows me EDIT, COPY, DELETE option in phpMyAdmin for every column.即使我已经像往常一样设置了一切,它通常会在 phpMyAdmin 中为我显示每一列的编辑、复制、删除选项。

For this db it doesn't.对于这个数据库,它没有。 Also when trying to run searchreplacedb it tells me that none of the tables have a "primary-key".此外,当尝试运行 searchreplacedb 时,它告诉我没有一个表具有“主键”。 I'm not sure how to fix that or what I have to set maybe when exporting so I have usual rights and everything works like normal.我不知道如何解决这个问题,或者我在导出时必须设置什么,所以我拥有通常的权利,一切正常。

Thanks for the help, Matt感谢您的帮助,马特

To do what u want u have to set a "primary key" in each table.要执行您想要的操作,您必须在每个表中设置一个“主键”。 When u do thatit will apear those options, to edit, delete and copy.当你这样做时,它会出现这些选项,用于编辑、删除和复制。

To add a "primary key" folow this video .要添加“主键”,请遵循此视频

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM