Manual talk:$wgDBmysql5

Charset problem after switching to wgDBmysql5 = true
Hello,

After years, we finally solve our charset issue and have been able to switch back to "wgDBmysql5 = false".

One of our symptoms was some special characters (like "φ") were converted silently (corrupt) into literal question marks (?).

How we resolved it is documented here in English and in French.

I hope this will help!

Jean-Luc

Convert MediaWiki database schema using legacy utf8 encoding to binary character set
My MediaWiki 1.31 installation (MariaDB) has a long history and was using  in LocalSettings.php along with utf8 (not utf8mb4) encoding in most of the MediaWiki tables (which is now discouraged in favor of the binary character set). Just omitting  or setting it to   caused database errors (shown to the user) as soon as a four byte unicode character is used (e.g. most emojis). So I decided to convert the database to the "current" SQL schema shipped with MediaWiki and I succeeded to to so (it should work for newer MediaWiki schemas as well). By the way: Using  on all tables does not result in the most up-to-date SQL schema (e.g.   vs.   differences).

Assuming the production database is called  and has some columns deviating from the up-to-date MediaWiki schema (e.g.   instead of   character set), create a (temporary) fresh database  and import the schema of the core and the used extensions:

Mentioned Python3 script: update_mediawiki_sql.py (GPL2+)

To give you a preview how the generated update_mediawiki.sql looks like, here is an excerpt:

Not covered by the script but a good idea is to additionally change the database default character set:

--Phispi (talk) 20:10, 10 January 2020 (UTC)