why varbinary instead of varchar

database, database-design, mysql, sql, sql-server

Solution

Mediawiki changed from varchar to varbinary in early 2011:

War on varchar. Changed all occurrences of varchar(N) and varchar(N) binary to varbinary(N). varchars cause problems ("Invalid mix of collations" errors) on MySQL databases with certain configs, most notably the default MySQL config.

Problem

Please take a look at this table : http://www.mediawiki.org/wiki/Manual:Logging_table As you can see wikipedia use varbinary instead of varchar : ``` | log_type | **varbinary**(32) | NO | MUL | | | log_action | **varbinary**(32) | NO | | | | log_timestamp | **binary**(14) | NO | MUL | 19700101000000 | | log_user | int(10) unsigned | NO | MUL | 0 | | log_user_text | **varbinary**(255) | | | | ``` All of these information are text , so why they save them as binary ? They do this for all tables .

Original source

Related problems