1.load data local infile '文件地址' into table 表名 fields terminated by ',' enclosed by '"' lines terminated by '/r/n' ignore 1 lines; #导入第一行为列名的“XX”,“XX”,“XX”格式数据
2.发现导入数据乱码,接着show variables like '%char%';
3.发现有些编码是Latin有些是gbk,都调成utf8,set XXX=utf8;【尝试过其他人说的修改配置文件的方法,修改后配置文件编码改变,重新保存为ANSI即可开启服务器,但是我改完有几个没有修改成功】
4.将需要导入的本地文本改为utf8编码,重新导入,成功。