Why my table doesnt support FOREIGN KEYS?

后端 未结 5 1325
盖世英雄少女心
盖世英雄少女心 2020-12-11 10:40

I have made a database and 10 tables in mysql(table type NONE) and i can\'t create foreign keys. An alert message says

SQLyog The selected table does not support for

5条回答
  •  情书的邮戳
    2020-12-11 11:07

    The MyISAM engine DOES support foreign keys. What it doesn't support is foreign key constraints.

    You can go ahead and create as many foreign keys as you like - but don't expect the database to enforce integrity for you.

    Don't change engines in your application without significant testing; changing engine will affect behaviour and is not recommended without great care and a lot of QA work. In particular, switching from MyISAM to InnoDB will break your application if:

    • It doesn't handle deadlocks appropriately (Deadlocks do not happen on MyISAM)
    • It expects table-level locking
    • It relies on (mostly dubious) MyISAM features
    • It is high performance and you have not understood how to tune InnoDB correctly, but did tune MyISAM well (or ok)
    • You have not assessed the disc space impact of switching engines

提交回复
热议问题