使用MySQL Query Browser编辑表记录时发现“有时”编辑按键是灰色的,这是什么原因呢?
我在使用MySQL之前用的是Access,就是它让我养成了不爱设置主键的坏习惯(因为Access是允许的)。
直接写SQL语言是可以正常操作的。
遇到问题后看了下官方文档发现原因所在:
The result area can be used to review and edit the results of a query, with editing permitted as long as the query is based on a single table and there is sufficient key information to uniquely identify rows. To edit the contents of the result area you must enable edit mode through the use of the EDIT button at the bottom of the result area. Any edits you make are not immediately applied, but instead you need to click the APPLY CHANGES button next to the EDIT button. Clicking the DISCARD CHANGES button throws away any changes you have made to the data.
设置主键之后自然就可以编辑了……