Logo name

Media Wiki:Specified key was too long; max key length is 1024 bytes

From IpbWiki

  • Currently5.00/5
Jump to: navigation, search

Contents

Symptons

During installation of MediaWiki you receive the following error:

CODE
Query "CREATE TABLE `job` ( job_id int(9) unsigned NOT NULL auto_increment, job_cmd varchar(255) NOT NULL default '', job_namespace int NOT NULL, job_title varchar(255) binary NOT NULL, job_params blob NOT NULL default '', PRIMARY KEY job_id (job_id), KEY (job_cmd, job_namespace, job_title) ) TYPE=InnoDB, DEFAULT CHARSET=utf8 " failed with error code "Specified key was too long; max key length is 1024 bytes (localhost)

or

CODE
Creating tables... using MySQL 4 table defs...Query "CREATE TABLE `job` ( job_id int(9) unsigned NOT NULL auto_increment, job_cmd varchar(255) NOT NULL default '', job_namespace int NOT NULL, job_title varchar(255) binary NOT NULL, job_params blob NOT NULL default '', PRIMARY KEY job_id (job_id), KEY (job_cmd, job_namespace, job_title) ) TYPE=InnoDB " failed with error code "Specified key was too long. Max key length is 500 (localhost)".

Fix

open file: tables.sql

Search for:

CODE
CREATE TABLE /*$wgDBprefix*/job (
 job_id int(9) unsigned NOT NULL auto_increment,
 
 -- Command name, currently only refreshLinks is defined
 job_cmd varchar(255) NOT NULL default '',

 -- Namespace and title to act on
 -- Should be 0 and '' if the command does not operate on a title
 job_namespace int NOT NULL,
 job_title varchar(255) binary NOT NULL,

 -- Any other parameters to the command
 -- Presently unused, format undefined
 job_params blob NOT NULL default '',

 PRIMARY KEY job_id (job_id),
 KEY (job_cmd, job_namespace, job_title)
) TYPE=InnoDB;

Replace with:

CODE
CREATE TABLE /*$wgDBprefix*/job (
 job_id int(9) unsigned NOT NULL auto_increment,
 
 -- Command name, currently only refreshLinks is defined
 job_cmd varchar(255) NOT NULL default '',

 -- Namespace and title to act on
 -- Should be 0 and '' if the command does not operate on a title
 job_namespace int NOT NULL,
 job_title varchar(255) binary NOT NULL,

 -- Any other parameters to the command
 -- Presently unused, format undefined
 job_params blob NOT NULL default '',

 PRIMARY KEY job_id (job_id),
 KEY (job_cmd (160), job_namespace, job_title (160))
) TYPE=InnoDB;

open file: /maintenance/tables.sql

Search for:

CODE
CREATE TABLE /*$wgDBprefix*/job (
 job_id int(9) unsigned NOT NULL auto_increment,
 
 -- Command name, currently only refreshLinks is defined
 job_cmd varchar(255) NOT NULL default '',

 -- Namespace and title to act on
 -- Should be 0 and '' if the command does not operate on a title
 job_namespace int NOT NULL,
 job_title varchar(255) binary NOT NULL,

 -- Any other parameters to the command
 -- Presently unused, format undefined
 job_params blob NOT NULL default '',

 PRIMARY KEY job_id (job_id),
 KEY (job_cmd, job_namespace, job_title)
) TYPE=InnoDB;

Replace with:

CODE
CREATE TABLE /*$wgDBprefix*/job (
 job_id int(9) unsigned NOT NULL auto_increment,
 
 -- Command name, currently only refreshLinks is defined
 job_cmd varchar(255) NOT NULL default '',

 -- Namespace and title to act on
 -- Should be 0 and '' if the command does not operate on a title
 job_namespace int NOT NULL,
 job_title varchar(255) binary NOT NULL,

 -- Any other parameters to the command
 -- Presently unused, format undefined
 job_params blob NOT NULL default '',

 PRIMARY KEY job_id (job_id),
 KEY (job_cmd (160), job_namespace, job_title (160))
) TYPE=InnoDB;

run the setup

After uploading the modified files you should now be able to install MediaWiki succesfully. user posted image

This page was last modified on 11 November 2006, at 15:18.  This page has been accessed 8,365 times.  Content is available under GNU Free Documentation License 1.2Disclaimers