0

从文档中,我正在创建pma_history表格。

这是唯一scripts/create_tables.sql失败的部分:

CREATE TABLE IF NOT EXISTS `pma_history` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `username` varchar(64) NOT NULL default '',
  `db` varchar(64) NOT NULL default '',
  `table` varchar(64) NOT NULL default '',
  `timevalue` timestamp(14) NOT NULL,
  `sqlquery` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `username` (`username`,`db`,`table`,`timevalue`)
)
  ENGINE=MyISAM COMMENT='SQL history for phpMyAdmin'
  DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

这是服务器所说的:

#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, `sqlquery` text NOT NULL, PRIMARY KEY (`id`), 
KEY `user' at line 6
4

1 回答 1

2

timestamp离开列的长度

`timevalue` timestamp NOT NULL

在 4.1 版本之前,MySQL 检索和显示 TIMESTAMP 值的格式取决于显示大小

取自这里

于 2012-08-01T16:36:16.757 回答