Specified key was too long; max key length is 1024 bytes (localhost)

Aus Wiki.csoft.at

Fehlermeldung bei Installation von Mediawiki

Inhaltsverzeichnis

Software

  • MediaWiki: 1.6.8, 1.9.3, 1.13.3
  • MySQL

Fehlermeldung

Creating tables... using MySQL 4 table defs...Query "CREATE TABLE `wiki_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 1024 bytes (localhost)".

Lösung

UTF8

In den Dateien

/maintenance/tables.sql
/maintenance/mysql5/tables.sql
/maintenance/archives/patch-job.sql

die Zeile

KEY (job_cmd, job_namespace, job_title)

ändern auf

KEY (job_cmd(160), job_namespace, job_title(160))

Fehler beim Updaten

Fehlermeldung:

Checking for categorylinks indices...
Checking if categorylinks index cl_sortkey includes field cl_from...
...index cl_sortkey on table categorylinks has no field cl_from; adding
Es gab einen Syntaxfehler in der Datenbankabfrage.
Die letzte Datenbankabfrage lautete: "ALTER TABLE `wiki_categorylinks`
 DROP INDEX cl_sortkey,
 ADD INDEX cl_sortkey(cl_to, cl_sortkey, cl_from)

" aus der Funktion "Database::sourceStream".

MySQL meldete den Fehler: "1071: Specified key was too long; max key length is 1024 bytes (localhost)".

Lösung:

vi /maintenance/archives/patch-categorylinksindex.sql

(160) einfügen:

ADD INDEX cl_sortkey(cl_to(160), cl_sortkey, cl_from);

latin1

ALTER DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

ALTER TABLE wiki_archive DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_categorylinks DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_externallinks DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_hitcounter DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_image DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_imagelinks DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_interwiki DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_ipblocks DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_job DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_logging DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_math DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_objectcache DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_oldimage DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_page DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_pagelinks DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_querycache DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_recentchanges DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_revision DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_searchindex DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_site_stats DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_templatelinks DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_text DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_trackbacks DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_transcache DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_user DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_user_groups DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_user_newtalk DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_validate DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wiki_watchlist DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

ALTER TABLE `wiki_archive` CHANGE `ar_title` `ar_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_archive` CHANGE `ar_user_text` `ar_user_text` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_archive` CHANGE `ar_timestamp` `ar_timestamp` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
# 160
ALTER TABLE `wiki_categorylinks` CHANGE `cl_to` `cl_to` VARCHAR( 160 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_categorylinks` CHANGE `cl_sortkey` `cl_sortkey` VARCHAR( 86 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_image` CHANGE `img_name` `img_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_image` CHANGE `img_media_type` `img_media_type` ENUM( 'UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA', 'OFFICE',  'TEXT', 'EXECUTABLE', 'ARCHIVE' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
ALTER TABLE `wiki_image` CHANGE `img_major_mime` `img_major_mime` ENUM( 'unknown', 'application', 'audio', 'image', 'text', 'video', 'message', 'model', 'multipart' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unknown';
ALTER TABLE `wiki_image` CHANGE `img_minor_mime` `img_minor_mime` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unknown';
ALTER TABLE `wiki_image` CHANGE `img_user_text` `img_user_text` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_image` CHANGE `img_timestamp` `img_timestamp` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_imagelinks` CHANGE `il_to` `il_to` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_interwiki` CHANGE `iw_prefix` `iw_prefix` CHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_interwiki` CHANGE `iw_url` `iw_url` CHAR( 127 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_ipblocks` CHANGE `ipb_address` `ipb_address` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_ipblocks` CHANGE `ipb_timestamp` `ipb_timestamp` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_ipblocks` CHANGE `ipb_expiry` `ipb_expiry` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_ipblocks` CHANGE `ipb_range_start` `ipb_range_start` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_ipblocks` CHANGE `ipb_range_end` `ipb_range_end` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
# 160
ALTER TABLE `wiki_job` CHANGE `job_cmd` `job_cmd` VARCHAR( 160 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_job` CHANGE `job_title` `job_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_logging` CHANGE `log_type` `log_type` CHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_logging` CHANGE `log_action` `log_action` CHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_logging` CHANGE `log_timestamp` `log_timestamp` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '19700101000000';
ALTER TABLE `wiki_logging` CHANGE `log_title` `log_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_logging` CHANGE `log_comment` `log_comment` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_math` CHANGE `math_inputhash` `math_inputhash` VARCHAR( 16 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_math` CHANGE `math_outputhash` `math_outputhash` VARCHAR( 16 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_math` CHANGE `math_html` `math_html` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
ALTER TABLE `wiki_math` CHANGE `math_mathml` `math_mathml` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
ALTER TABLE `wiki_objectcache` CHANGE `keyname` `keyname` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_oldimage` CHANGE `oi_name` `oi_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_oldimage` CHANGE `oi_archive_name` `oi_archive_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_oldimage` CHANGE `oi_user_text` `oi_user_text` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_oldimage` CHANGE `oi_timestamp` `oi_timestamp` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_page` CHANGE `page_title` `page_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_page` CHANGE `page_touched` `page_touched` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_pagelinks` CHANGE `pl_title` `pl_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_querycache` CHANGE `qc_type` `qc_type` CHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_querycache` CHANGE `qc_title` `qc_title` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_recentchanges` CHANGE `rc_timestamp` `rc_timestamp` VARCHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_recentchanges` CHANGE `rc_cur_time` `rc_cur_time` VARCHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_recentchanges` CHANGE `rc_user_text` `rc_user_text` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_recentchanges` CHANGE `rc_title` `rc_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_recentchanges` CHANGE `rc_comment` `rc_comment` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_recentchanges` CHANGE `rc_moved_to_title` `rc_moved_to_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_recentchanges` CHANGE `rc_ip` `rc_ip` CHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_revision` CHANGE `rev_user_text` `rev_user_text` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_revision` CHANGE `rev_timestamp` `rev_timestamp` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_searchindex` CHANGE `si_title` `si_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_searchindex` CHANGE `si_text` `si_text` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_templatelinks` CHANGE `tl_title` `tl_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_trackbacks` CHANGE `tb_title` `tb_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_trackbacks` CHANGE `tb_url` `tb_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_trackbacks` CHANGE `tb_ex` `tb_ex` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
ALTER TABLE `wiki_trackbacks` CHANGE `tb_name` `tb_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
ALTER TABLE `wiki_transcache` CHANGE `tc_url` `tc_url` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_transcache` CHANGE `tc_contents` `tc_contents` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
ALTER TABLE `wiki_user` CHANGE `user_name` `user_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_user` CHANGE `user_real_name` `user_real_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_user` CHANGE `user_email` `user_email` TINYTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_user` CHANGE `user_touched` `user_touched` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_user` CHANGE `user_token` `user_token` CHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_user` CHANGE `user_email_authenticated` `user_email_authenticated` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL;
ALTER TABLE `wiki_user` CHANGE `user_email_token` `user_email_token` CHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL;
ALTER TABLE `wiki_user` CHANGE `user_email_token_expires` `user_email_token_expires` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL;
ALTER TABLE `wiki_user` CHANGE `user_registration` `user_registration` CHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL;
ALTER TABLE `wiki_user_groups` CHANGE `ug_group` `ug_group` CHAR( 16 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_user_newtalk` CHANGE `user_ip` `user_ip` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_validate` CHANGE `val_comment` `val_comment` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_validate` CHANGE `val_ip` `val_ip` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `wiki_watchlist` CHANGE `wl_title` `wl_title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;
ALTER TABLE `wiki_watchlist` CHANGE `wl_notificationtimestamp` `wl_notificationtimestamp` VARCHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL;