#1072 - 关键栏'名称'表格中不存在

时间:2016-02-13 16:15:29

标签: mysql

CREATE TABLE IF NOT NOT EXISTS ban

UID int(4)NOT NULL,

AdminUID int(4)NOT NULL,

Grund varchar(50)NOT NULL,

Datum varchar(50)NOT NULL,

IP varchar(50)NOT NULL DEFAULT' 0',

Serial varchar(50)NOT NULL,

Eintragsdatum时间戳NOT NULL DEFAULT CURRENT_TIMESTAMP,

STime int(11)NOT NULL DEFAULT' 0' , PRIMARY KEY(UID), KEY NameName), KEY IPIP), KEY SerialSerial), KEY STimeSTime) )ENGINE = MyISAM DEFAULT CHARSET = latin1;

错误:

1072 - 关键栏'名称'表

中不存在

我的错在哪里?

1 个答案:

答案 0 :(得分:0)

删除代码中的KEY Name(Name),因为表中没有Name字段。

CREATE TABLE IF NOT EXISTS ban (

UID int(4) NOT NULL,

AdminUID int(4) NOT NULL,

Grund varchar(50) NOT NULL,

Datum varchar(50) NOT NULL,

IP varchar(50) NOT NULL DEFAULT '0',

Serial varchar(50) NOT NULL,

Eintragsdatum timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

STime int(11) NOT NULL DEFAULT '0' , PRIMARY KEY (UID), KEY IP (IP), KEY Serial (Serial), KEY STime (STime) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;