1
我在MySQL中創建了一個名爲'ShoppingCart'的表,但它顯示錯誤1005.這裏有什麼錯誤?MySQL中的錯誤1005
mysql> create table ShoppingCart(
-> Current_Purchases varchar(100),
-> Previous_Purchases varchar(100),
-> Phone_No int(20),
-> constraint fk_shop foreign key (Phone_No) references Registration(Phone_No));
ERROR 1005 (HY000): Can't create table 'infoproject.shoppingcart' (errno: 150)
其他表'Registration'已經創建並且相同的列存在相同的數據類型。
在兩欄中的Phone_no上創建一個索引 – hjpotter92
'phone_no'是'registration'表的主鍵(或者至少有一個唯一的約束)? –
@a_horse_with_no_name不,我沒有使用任何約束'Phone_no' – LuluLala