使用 mysql 创建 table 并在 sql 字符串中设置 TYPE=InnoDB

create table with mysql and set TYPE=InnoDB in the sql string

我想用这个代码创建一个 mysql table:

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;

它来自 OpenGeoDb 的 mysql 转储。

所以不是我自己创造的。 如果我在 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 

但我找不到问题所在。也许有人可以帮助我?

非常感谢。

TYPEENGINE 取代。 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;