0

From documentation, I'm creating pma_history table.

This is the only part of scripts/create_tables.sql that fails:

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;

This is what server says:

#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

Leave the length of the timestamp column

`timevalue` timestamp NOT NULL

Prior to version 4.1, the format in which MySQL retrieves and displays TIMESTAMP values depends on the display size

Taken from here

于 2012-08-01T16:36:16.757 に答える