---
title: "mysql创建外键关联 自己的代码总提示“ERROR 1005: Can't create table (errno: 150)”"
author: "f002489"
date: "2010-06-17T18:00:16Z"
tags: ["Blog", "MySQL"]
categories: ["数据库"]
slug: "mysql-error-1005-can-t-create-table-errno-150"
draft: false
lastmod: "2010-06-17T18:00:16Z"
id: 693300
url: "https://f002489.iteye.com/blog/693300"
---

http://eternal1025.iteye.com/blog/425311

 

1. 为了建立两个MySQL表之间的一个外键关系，必须满足以下三种情况：
2. * 两个表必须是InnoDB表类型。
3. * 使用在外键关系的域必须为索引型(Index)。
4. * 使用在外键关系的域必须与数据类型相似。