You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在phpMyAdmin Designer中查看数据表关联?为何新增表关联不显示?

Fix: phpMyAdmin Designer Not Showing Table Relationships

I’ve run into this exact issue before, so let’s walk through the most common fixes to get those table relationships visible in phpMyAdmin’s Designer tool.

1. Confirm Your Tables Support Foreign Keys

First off, double-check your table storage engine—MyISAM doesn’t support foreign key constraints, which means the Designer can’t detect relationships even if you intended them.

  • To verify: Go to your table’s Operations tab, look under "Table options" for the "Storage Engine" field.
  • To fix: Switch the engine to InnoDB (or XtraDB, both support FKs) using the dropdown, then click "Go".
  • Also, confirm foreign keys are actually defined: Head to the table’s Structure tab, scroll to the bottom, and click "Relation view". If your FKs are set up correctly, they’ll be listed here.

2. Tweak Designer Tool Settings

Sometimes the relationships are there—you just need to enable their display:

  • Open the Designer tool, then click the gear-shaped Settings icon in the top toolbar.
  • In the settings panel, make sure these options are checked:
    • "Show foreign key relationships"
    • (Optional) "Show columns" to see which specific fields are linked
  • Save the settings and refresh the Designer page.

3. Refresh and Clear Caches

Occasionally, the Designer gets stuck with outdated data. Try these quick fixes:

  • Click the Refresh button in the Designer’s toolbar.
  • Log out of phpMyAdmin, then log back in to reset the session.
  • Do a hard refresh of your browser (press Ctrl+Shift+R on Windows/Linux, Cmd+Shift+R on Mac) to clear local cache.

4. Recreate Foreign Keys (If They’re Missing)

If the Relation view shows no foreign keys, you’ll need to define them properly:

  1. Go to the child table’s Structure tab.
  2. Scroll to the bottom and click "Relation view".
  3. For the column that should act as a foreign key, select the parent table and matching column from the dropdown menus.
  4. Set "ON DELETE" and "ON UPDATE" actions (like CASCADE or RESTRICT) if needed, then click "Save".
  • After recreating the FKs, return to the Designer and refresh—your relationships should now show up.

内容的提问来源于stack exchange,提问作者Amine MRAIHI

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:48:51