Search code examples
mysqldatabasemyisam

What is the meaning of MyISAM doesn't support foreign key?


As I read on https://dev.mysql.com/doc/refman/8.0/en/storage-engines.html, MyISAM storage engine doesn't support foreign key on MySQL 8.0. But when i tried on my database, the foreign key is created successfully.

Can anyone tell me what is the true meaning of MyISAM doesn't support foreign key?

Note, i tried the code on Navicat with MySQL v.8.0

Screen Capture of my Navicat when I created the tables [the result of SHOW CREATE TABLE utama;]1


Solution

  • For storage engines that do not support foreign keys (such as MyISAM), MySQL Server parses and ignores foreign key specifications.

    from the docs

    That means you can define a foreign key but it does not have any effect.