MediaWiki Installation Tricks regarding MySql database versions

When I installed mediawiki version 1.5 the first time and was prompted for database features, I used the default option – backward compatibility. _ I later guess that it used features of MySql prior to version 4.1. That caused the problem:

First, after installation, you get SQL error 1271 when hitting pages like “Recent Changes”. I later looked into the codes and found the issue. Basically, if you have the query like this when your default character set of MySql is utf-8 you’ll get this SQL error.

select * from some_table where some_col =’test’

The reason is, some_col is utf-8 collation, while string literal ‘test’ was treated as collation latin1. So the comparison failed, prior to MySql version 4.

I got around the pronblem by inserting something like this in includes/Database.php in mediawiki installation source codes:

select * from some_table where convert(some_col using latin1) =’test’

SQL error disappeared. However, after that, I had the second problem. My link and categories all show red, regradless if the linked pages/categories were defined or not.

I suspect that is the same issue with the first as comparison failed due to collation conflicts. I ddin’t want to spend too much on it so I want ahaed to reinstall it and this time I chosed database MySql version 4/5 (NOT backward compatiable).

All issues were resolved and mediawiki worked like a charm.

Footer