Problem

I wanted Django’s syncdb command to create my tables as InnoDB with a default character set of utf8 and collation of utf8_unicode_ci.

Solution

  1. Create a file /etc/my.cnf with the following contents (or add to current my.cnf):

    [mysqld]
    default_table_type = InnoDB
    collation_server=utf8_unicode_ci
    character_set_server=utf8
    
  2. Assuming you’re just starting a new project, delete the database you created for it already.

  3. Stop and restart MySQL.

If there is data you need to preserve in the database, then you’ll have to convert it the long way instead of deleting the database.