How to create relationship using navicat ?

HI

I am using navicat to create tables and its relationships but when I try to create a foreign key, navicat only creates an index but not the foreign key.

Regards
dimensionavAsked:
Who is Participating?
 
nitinmehtaCommented:
I'm sorry if it sounds dumb but have you checked the engine of the table(s) created? Foreign keys are only possible with InnoDB and generally MySQL doesn't throw an error when you try to create them on.. say a MyISAM table.

Regards,
0
 
dimensionavAuthor Commented:
nitinmehta:

I see, those tables are MyISAM, where can I change this on navicat?

And please, I am not that skilled on MySQL, would you mind to tell me why are different types of engines and what are those for?

Thanks!
0
 
dimensionavAuthor Commented:
0
 
nitinmehtaCommented:
I hope you've found the solution now but just to answer your questions,

1) You can run a simple command to change the engine:
ALTER TABLE table_name ENGINE=''InnoDB';

2) MySQL has this feature 'pluggable engine' which makes it possible for you to add the engine of your choice to work on different type of data and with diff type of applications. For ex MYISAM is very good for read-only applications because of the speed and because it's good for read-only, does not concentrate on transactions and thus no foreign keys and relationships and locks are at table level. Innodb is MySQL's transaction database and is more close to an RDBMS. MySQL has many more engine types and different use for all of them.

Hope that helps...

Regards,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.