MediaWiki not DB creation failing

MediaWiki installed just fine, and I went through the setup without issue. It connected to the database, and eveything returned success messages except when it was creating the tables. I got the following error:

Creating tables… using MySQL 4 table defs…Query "CREATE TABLE mwiki_categorylinks ( cl_from int(8) unsigned NOT NULL default ‘0’, cl_to varchar(255) binary NOT NULL default ‘’, cl_sortkey varchar(86) binary NOT NULL default ‘’, cl_timestamp timestamp NOT NULL, UNIQUE KEY cl_from(cl_from,cl_to), KEY cl_sortkey(cl_to,cl_sortkey), KEY cl_timestamp(cl_to,cl_timestamp) ) TYPE=InnoDB " failed with error code “Specified key was too long; max key length is 1000 bytes (”.

This seems to come up a lot. Any suggestions as to how to corerct this so that the tables get created successfully?

According to a Google search, it looks like the problem with that many of these kinds of PHP/MySQL applications is that they require databases to be created created with a MySQL charset of “latin1_bin”, not “UTF-8 Unicode”. So how can I modify the database structure to have the proper latin1_bin charset? I can update the “MySQL connection collation” through phpMyAdmin, but I cannot change the “MySQL charset”.

Is this the correct resolution, or am I going down the wrong path?

How have others gotten this to work?

Well, I guess I fixed this myself. I remember I had a similar issue when I installed Joomla! on a Dreamhost-hosted database, so I went to the Joomla! forums and found the answer there:

  1. Open phpMyAdmin

  2. Delete all tables (if any)

  3. Launch SQL

  4. Enter and run the following SQL code:


where ‘dbname’ is the name of the database.

  1. launch the MediaWiki setup again and let it re-create the tables. Voila! it works!

NOTE: This will DESTROY ALL EXISTING DATA because you have to drop then re-create the tables! Be forewarned!

Just wondering. Were you doing your own install or the one-click install?


Opinions are my own views and not the views of DreamHost. :open_mouth:
Any advice offered by me should be acted upon at your own risk.