How to import Mysql dumps into UTF-8?

Asked

Viewed 341 times

2

I’m trying to import a dump Mysql (in UTF-8), generated in Windows by Navicat, on a server Centos 6.5 with Mysql 5.5.

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

mysql -uroot -p database < dump.sql

Mysql imports the file but does not prevail the UTF-8 enconding, and all information with special characters gets corrupted.

Example:

'Inteligência de Negócios'

Instead of

'Inteligência de Negócios'

How should I proceed to import the file correctly prevailing the UTF-8 encoding

1 answer

1

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

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

mysql> SOURCE dump.sql

Browser other questions tagged

You are not signed in. Login or sign up in order to post.