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 に答える