2015-09-16 37 views
1

我想創建一個MySQL表使用此代碼:創建MySQL表,並設置TYPE = InnoDB中的SQL字符串

create table geodb_type_names (
    type_id    integer not null, 
    type_locale   varchar(5) not null, 
    name     varchar(255) not null,    /* varchar(500)? */ 
unique (type_id, type_locale) 
) TYPE=InnoDB CHARACTER SET utf8; 

它來自於一個MySQL轉儲OpenGeoDb。

所以我沒有自己創造它。 如果我包括在phpMyAdmin這種說法我收到此錯誤信息:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=InnoDB CHARACTER SET utf8' at line 10 

但我不能找到問題。也許有人可以幫助我?

非常感謝。

+0

[1064錯誤在CREATE TABLE ... TYPE = MYISAM](可能重複http://stackoverflow.com/questions/12428755/1064-error-in-create -table-myisam) –

+0

現在TYPE不使用。請使用ENGINE來代替TYPE。 – Sonia

回答

1

TYPE被替換爲ENGINE。 TYPE在MySQL 4.0中被棄用,並在MySQL 5.5中被刪除。

使用此查詢:

create table geodb_type_names (
    type_id    integer not null, 
    type_locale   varchar(5) not null, 
    name     varchar(255) not null,    /* varchar(500)? */ 
unique (type_id, type_locale) 
) ENGINE=InnoDB CHARACTER SET utf8; 
+0

謝謝。我會在幾分鐘內嘗試。 – cgee