How to import MySQL dumps into UTF-8?

2

I'm trying to import a dump from MySQL (UTF-8), generated in Windows by Navicat, on a CentOS 6.5 server with MySQL 5.5 .

The problem generated with this is ... when executing the following command:

mysql -uroot -p database < dump.sql

MySQL imports the file but UTF-8 caching does not prevail, and all information with special characters becomes corrupted.

Example:

'Inteligência de Negócios'

Instead of

'Inteligência de Negócios'

How do I proceed to import the file correctly UTF-8 encoding prevails

    
asked by anonymous 30.01.2014 / 20:17

1 answer

1

The solution I found to this problem was to use --default-character-set=utf8 option in the import command, as the example below:

mysql -uroot -p --default-character-set=utf8 database

mysql> SOURCE dump.sql
    
30.01.2014 / 20:19