1

我收到此错误:

#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, 
`ID_MEMBER` mediumint(8) unsigned NOT NULL default '0', `ip` ' at line 3

当我运行这个脚本时:

  CREATE TABLE IF NOT EXISTS `MVElog_online` (
  `session` varchar(32) NOT NULL default '0',
  `logTime` timestamp(14) NOT NULL,
  `ID_MEMBER` mediumint(8) unsigned NOT NULL default '0',
  `ip` int(10) unsigned NOT NULL default '0',
  `url` text NOT NULL,
  PRIMARY KEY  (`session`),
  KEY `logTime` (`logTime`),
  KEY `ID_MEMBER` (`ID_MEMBER`)
) ENGINE=MyISAM;

错误是什么意思,我做错了什么?

4

1 回答 1

3

timestamp不应该有长度,(timestamp不是timestamp(14)

CREATE TABLE IF NOT EXISTS `MVElog_online` (
  `session` varchar(32) NOT NULL default '0',
  `logTime` timestamp NOT NULL,                 -- HERE
  `ID_MEMBER` mediumint(8) unsigned NOT NULL default '0',
  `ip` int(10) unsigned NOT NULL default '0',
  `url` text NOT NULL,
  PRIMARY KEY  (`session`),
  KEY `logTime` (`logTime`),
  KEY `ID_MEMBER` (`ID_MEMBER`)
) ENGINE=MyISAM;
于 2013-03-05T14:45:16.367 回答