SQL syntax

Fermé
aruju Messages postés 2213 Date d'inscription dimanche 29 octobre 2006 Statut Contributeur Dernière intervention 15 novembre 2014 - 11 nov. 2008 à 17:49
aruju Messages postés 2213 Date d'inscription dimanche 29 octobre 2006 Statut Contributeur Dernière intervention 15 novembre 2014 - 11 déc. 2008 à 15:34
Bonjour,

je reviens vers vous avec le problème suivant, j'essaye d'installer le plugin statistics dans dokuwiki et pour cela je dois exécuter requête sql sur mysql de mon hébergeur (1and1), la voici:

CREATE TABLE `stats_access` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `dt` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `page` varchar(255) collate utf8_unicode_ci NOT NULL,
  `ip` varchar(15) collate utf8_unicode_ci NOT NULL,
  `ua` varchar(255) collate utf8_unicode_ci NOT NULL,
  `ua_info` varchar(255) collate utf8_unicode_ci NOT NULL,
  `ua_type` varchar(32) collate utf8_unicode_ci NOT NULL,
  `ua_ver` varchar(10) collate utf8_unicode_ci NOT NULL,
  `os` varchar(32) collate utf8_unicode_ci NOT NULL,
  `ref_md5` varchar(32) collate utf8_unicode_ci NOT NULL,
  `ref_type` varchar(32) collate utf8_unicode_ci NOT NULL,
  `ref` text collate utf8_unicode_ci NOT NULL,
  `screen_x` int(10) unsigned NOT NULL,
  `screen_y` int(10) unsigned NOT NULL,
  `view_x` int(10) unsigned NOT NULL,
  `view_y` int(10) unsigned NOT NULL,
  `user` varchar(255) collate utf8_unicode_ci NOT NULL,
  `session` varchar(255) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `ref_type` (`ref_type`),
  KEY `page` (`page`),
  KEY `ref_md5` (`ref_md5`),
  KEY `dt` (`dt`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

-- 
-- Table structure for table `stats_iplocation`
-- 

CREATE TABLE `stats_iplocation` (
  `ip` varchar(15) collate utf8_unicode_ci NOT NULL,
  `code` varchar(3) collate utf8_unicode_ci NOT NULL,
  `country` varchar(255) collate utf8_unicode_ci NOT NULL,
  `city` varchar(255) collate utf8_unicode_ci NOT NULL,
  `host` varchar(255) collate utf8_unicode_ci NOT NULL,
  `lastupd` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`ip`),
  KEY `code` (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- added 2007-01-28
ALTER TABLE `stats_access` CHANGE `dt` `dt` DATETIME NOT NULL ;
ALTER TABLE `stats_access` ADD `js` TINYINT( 1 ) NOT NULL AFTER `view_y` ;
UPDATE `stats_access` SET js = 1 ;

-- added 2007-01-31
ALTER TABLE `stats_access` ADD `uid` VARCHAR( 50 ) NOT NULL ;


CREATE TABLE `stats_outlinks` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `dt` datetime NOT NULL,
  `session` varchar(255) collate utf8_unicode_ci NOT NULL,
  `link_md5` varchar(32) collate utf8_unicode_ci NOT NULL,
  `link` text collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `link_md5` (`link_md5`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- added 2007-02-04
ALTER TABLE `stats_outlinks` ADD `page` VARCHAR( 255 ) NOT NULL AFTER `dt` ;

CREATE TABLE `stats_search` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `dt` datetime NOT NULL,
  `page` varchar(255) collate utf8_unicode_ci NOT NULL,
  `query` varchar(255) collate utf8_unicode_ci NOT NULL,
  `engine` varchar(255) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE `stats_searchwords` (
  `sid` BIGINT UNSIGNED NOT NULL ,
  `word` VARCHAR( 255 ) NOT NULL ,
  PRIMARY KEY ( `sid` , `word` )
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- statistic fixes
update stats_access set ref_type='external' where ref LIKE 'http://digg.com/%';
update stats_access set ref_type='external' where ref LIKE 'http://del.icio.us/%';
update stats_access set ref_type='external' where ref LIKE 'http://www.stumbleupon.com/%';
update stats_access set ref_type='external' where ref LIKE 'http://swik.net/%';
update stats_access set ref_type='external' where ref LIKE 'http://segnalo.alice.it/%';

-- added 2008-06-15
CREATE TABLE `stats_refseen` (
  `ref_md5` varchar(32) collate utf8_unicode_ci NOT NULL,
  `dt` datetime NOT NULL,
  PRIMARY KEY ( `ref_md5` ),
  KEY `dt` (`dt`)
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- This will take some time...
INSERT INTO stats_refseen (ref_md5,dt) SELECT ref_md5, MIN(dt) FROM stats_access GROUP BY ref_md5;


Mais j'obtiens une erreur:

#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 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`page` varcha


En effet le script et pour la version: : 5.0.30 tandis que mon hébergeur a la version 4.0

J'imagine qu'il faut adapter mon script mais comment?

merci d'avance
A voir également:

1 réponse

aruju Messages postés 2213 Date d'inscription dimanche 29 octobre 2006 Statut Contributeur Dernière intervention 15 novembre 2014 403
11 déc. 2008 à 15:34
bonjour,

toujours pas de solutions...
0