MySQL

General:

Pro:

Con:

-- MikeOrr - 31 Dec 2001

Configuration Tips:

Switching to UTF-8

Nowadays it is best to use UTF-8 encoded strings throughout your application. Here is how you can configure MySQL to work with UTF-8, if you were using latin-1 before.

Adapt your configuration in /etc/mysql/my.cnf:

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
default-character-set=utf8
skip-character-set-client-handshake

Using mysql oder phpmyadmin:

SHOW VARIABLES LIKE 'char%'

This should look like:

character_set_client        utf8
character_set_connection    utf8
character_set_database      latin1
character_set_filesystem    binary
character_set_results       utf8
character_set_server        utf8
character_set_system        utf8
character_sets_dir          /usr/share/mysql/charsets/

Restart the server:

/etc/init.d/mysql restart

If you already have data stored, change the encoding in the database dump from varchar(n) to varchar(n) collate utf8_unicode_ci and change the DEFAULT CHARSET=latin1 to DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci.

See also: http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html (note the post by Yuri Tsarev) and http://tahpot.blogspot.com/2005/06/mysql-and-python-and-unicode.html

-- Tobias - 14 Apr 2010