1、导出数据库

mysqldump -u root -p —default-character-set=latin1 —create-options=false —set-charset=false db_name > /home/back.sql

2、创建新数据库

CREATE DATABASE db_name CHARACTER SET utf8 COLLATE utf8_general_ci

3、导入数据库

mysql -u root -p —default-character-set=gbk db_name < /home/back.sql