我想用这段代码创建一个 mysql 表:
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
但我找不到问题所在。也许有人可以帮助我?
非常感谢。
最佳答案
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;
关于mysql - 使用 mysql 创建表并在 sql 字符串中设置 TYPE=InnoDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32602210/