gpt4 book ai didi

mysql - SQL查询错误 #1064 in primary key declaration

转载 作者:行者123 更新时间:2023-12-01 00:27:59 26 4
gpt4 key购买 nike

CREATE TABLE conversationlog(
bot TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0',
id INT( 11 ) NOT NULL AUTO_INCREMENT ,
input TEXT,
response TEXT,
uid VARCHAR( 255 ) DEFAULT NULL ,
enteredtime TIMESTAMP( 14 ) NOT NULL ,
PRIMARY KEY ( id ) ,
KEY botid( bot )
) ENGINE = MYISAM ;

MySQL 说:

#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 '(14) NOT NULL, PRIMARY KEY (id), KEY botid (bot) ) ENGINE=MyISAM' at l ine 7

写这个SQL查询来创建 session 日志,我不知道为什么会出现错误。请指正。

最佳答案

你错过了 enteredtimeTIMESTAMP 之间的空格:

enteredtime TIMESTAMP( 14 ) NOT NULL ,

关于mysql - SQL查询错误 #1064 in primary key declaration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10582622/

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