Topic on Project:Support desk

Database "ENGINE=MyISAM, DEFAULT CHARSET=binary" help

5
151.229.250.233 (talkcontribs)

Hi is it correct that default charset should be binary for MyISAM if not what should it be. My web host MySQL crashed last year and so it broke MySQL for InnoDB they are trying to fix it in the mean time they asked us to use MyISAM. My database shows it as all binary should It be binary.

88.130.114.156 (talkcontribs)

Yes, binary is what is recommended. The other option would be UTF-8, but if you do not have a charset problem currently, I would just not touch this setting. See Manual:$wgDBTableOptions for more information! Btw: This value is used for new tables/columns, changing it won't change what you already have in the DB.

151.229.250.233 (talkcontribs)

Thanks and what is the difference between them both is binary better then utf-8

151.229.250.233 (talkcontribs)

Should searchindex be utf-8 or binary because it was created as utf-8 and everything else as binary.

88.130.92.137 (talkcontribs)

For MediaWiki, the difference mainly is whether we need to do charset conversions: MediaWiki internally always uses UTF-8, but both, UTF-8 and binary encoding, will make it so that no charset conversion will be needed. Binary has the advantage, that data inside binary fields - from the perspective of MySQL - has no charset. That means MySQL won't even think about doing any conversions on it.

The table "searchindex" is the only one, which cannot be converted to binary; it should still be UTF-8. Here is the source code for the table creation:

https://phabricator.wikimedia.org/diffusion/MW/browse/master/maintenance/tables.sql

Reply to "Database "ENGINE=MyISAM, DEFAULT CHARSET=binary" help"