Q

MyISAM and foreign key support

Are foreign key constraints supported in MyISAM of MySQL? I have created a table using InnoDB, declaring the foreign

key, and now I want to convert that table to MyISAM. Is it possible, and if so, how can I do it?

While FOREIGN KEY constraints are on the to-do list of features to be added to the MyISAM table handler, they are not yet implemented and may not be for some time. In the meantime you may find InnoDB to be a fine table handler for most purposes, but if you absolutely must move the table to MyISAM then you will lose the ability to enforce foreign keys.

To convert a table to a different table handler, the following syntax can be used:

ALTER TABLE tablename TYPE = MyISAM;


This was first published in October 2004

Dig deeper on Open source databases

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataCenter

SearchServerVirtualization

SearchCloudComputing

SearchEnterpriseDesktop

Close