gpt4 book ai didi

mySQL 5.5.43 语法错误

转载 作者:行者123 更新时间:2023-11-29 06:51:25 25 4
gpt4 key购买 nike

我正在进行 Mantis 数据库升级,在运行创建表命令时收到以下错误。有人可以帮我看看 mysql 语法有什么问题吗?

这是错误消息:

Schema CreateTableSQL ( )   BAD
CREATE TABLE (
email_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
email VARCHAR(64) NOT NULL DEFAULT '',
subject VARCHAR(250) NOT NULL DEFAULT '',
submitted DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01',
metadata LONGTEXT NOT NULL,
body LONGTEXT NOT NULL,
PRIMARY KEY (email_id) )
ENGINE=MyISAM

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 '( email_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, email ' at line 1

这是schema.php中创建表代码的一部分

$upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_email_table'),"
email_id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
email C(64) NOTNULL DEFAULT \" '' \",
subject C(250) NOTNULL DEFAULT \" '' \",
submitted T NOTNULL DEFAULT '1970-01-01 00:00:01',
metadata XL NOTNULL,
body XL NOTNULL
",Array('mysql' => 'ENGINE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));

最佳答案

您尚未为表提供名称:

CREATE TABLE  # name is missing here

( email_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT
, email VARCHAR(64) NOT NULL DEFAULT ''
, subject VARCHAR(250) NOT NULL DEFAULT ''
, submitted DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01'
, metadata LONGTEXT NOT NULL
, body LONGTEXT NOT NULL
, PRIMARY KEY (email_id)
)ENGINE=MyISAM

关于mySQL 5.5.43 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47297957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com