Drupal coder

migration

Importing a UTF-8 database and keep special characters

This is a follow up to the post "Creating a UTF-8 database to work with special characters".

When you want to move your database from one server/database to another one, you generally create a sql dump file from the source database using the mysqldump command and then do an import into the destination using the mysql source statement or via shell redirection (<).

This is just a heads up. When you make the connection on the destination server/database, specify the --default-character-set=utf8 option.

You end up with something like:

mysql -u user -ppassword --default-character-set=utf8 database < "dump.sql"
April 29, 2008Drupal, i18n, migration, MySQL