为什么我的桌子不支持外键? [英] Why my table doesnt support FOREIGN KEYS?
问题描述
我在mysql中建立了一个数据库和10个表(表类型为NONE) 而且我无法创建外键.一条警告消息说
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 所选表不支持外键. 表引擎必须是InnoDB,PBXT或SolidDB
SQLyog The selected table does not support foreign keys. Table engine must be InnoDB, PBXT or SolidDB
我现在必须更改所有表格吗? 感谢您的任何提示或建议
Will i must alter all of my tables now? thanks for any hint or suggestion
推荐答案
通常,InnoDB用于支持外键和事务:
Typically, InnoDB is used to support foreign keys, and transactions:
http://dev.mysql.com/doc/refman/5.1/en/innodb.html
您可以随时更改表引擎:
You can change the table engine on the fly:
ALTER TABLE tableName ENGINE = InnoDB;
您还可以更改默认值(对于新创建的表),如下所示:
You can also change the default -- for newly created tables -- as shown here:
http://dev.mysql.com/doc/refman/5.1/en/storage-engine-setting.html
这篇关于为什么我的桌子不支持外键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!