I received the following error while installing Mediawiki-1.9.3 while updating an existing database:
Query "ALTER TABLE `imagelinks` DROP INDEX il_to, ADD INDEX il_to(il_to, il_from) " failed with error code "Specified key was too long. Max key length is 500 (mysql.ibiblio.org)".
This coding appears to come from patch-backlinkindexes.sql
ALTER TABLE /*$wgDBprefix*/pagelinks DROP INDEX pl_namespace, ADD INDEX pl_namespace(pl_namespace, pl_title, pl_from);
ALTER TABLE /*$wgDBprefix*/templatelinks DROP INDEX tl_namespace, ADD INDEX tl_namespace(tl_namespace, tl_title, tl_from);
ALTER TABLE /*$wgDBprefix*/imagelinks DROP INDEX il_to, ADD INDEX il_to(il_to, il_from);
Any suggestions?
Fred
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160
... Specified key was too long. Max key length is 500
This is a MySQL bug related to the way indexes counts bytes and not characters. This in turn is because MySQL has a limitation on the number of total bytes one can use in an index. For more information, see:
http://bugzilla.wikimedia.org/show_bug.cgi?id=1322
Any suggestions?
There are four things you can do, in order of ease:
1) Change the index definitions (see the bug above for examples) 2) Don't use UTF-8. 3) Use Postgres 4) Recompile a custom MySQL with a larger limit
- -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200703211008 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
- Change the index definitions (see the bug above for examples)
- Don't use UTF-8.
- Use Postgres
- Recompile a custom MySQL with a larger limit
5) use newer version than 3.23 6) use InnoDB
3) and 4) are slightly wrong, but.. ;-)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Fred Bauder wrote:
I received the following error while installing Mediawiki-1.9.3 while updating an existing database:
Query "ALTER TABLE `imagelinks` DROP INDEX il_to, ADD INDEX il_to(il_to, il_from) " failed with error code "Specified key was too long. Max key length is 500 (mysql.ibiblio.org)".
Sounds like you're running an old version of MySQL without InnoDB support? In relatively modern installations the limit should be 1000 bytes for MyISAM, 1024 for InnoDB iirc.
Try upgrading / enabling InnoDB and changing the table to InnoDB...
- -- brion vibber (brion @ wikimedia.org)
mediawiki-l@lists.wikimedia.org