mysql load data 乱码

解决方案:  http://stackoverflow.com/questions/26256421/sql-load-data-infile-utf8-issue

即:

load data local infile '/path/to/sqlfile' 
into table xxx 
character set utf8
fields terminated by ','
lines terminated by '\n';

 

into table xxx 后紧接着指定字符集 character set utf8;

 

/path/to/sqlfile 放在/etc/my.cnf 文件datadir定义的路径下, 传值传相对路径。

posted @ 2016-12-05 13:59  tommy.yu  阅读(411)  评论(0编辑  收藏  举报