1.修改字符编码,全部修改为gbk。
show variables like ‘%char%‘; set character_set_database=gbk;
2.创建数据库
CREATE SCHEMA `kingdee` ;
3. 创建表
CREATE TABLE `kingdee`.`t0803` ( `FPRODUCTID` VARCHAR(50) NULL, `FPRODUCTVER` VARCHAR(20) NULL, `FPRODUCTREGNO` VARCHAR(100) NULL, `FACCOUNTNAME` VARCHAR(200) NULL, `FACCOUNTUSER` VARCHAR(50) NULL, `FYSUSER` VARCHAR(50) NULL, `FADDITIONALINFO` VARCHAR(60) NULL, `FINDUSTRY` VARCHAR(100) NULL, `FBUSINESS` VARCHAR(100) NULL, `FFUNCTIONKEY` VARCHAR(128) NULL, `FOPERATIONCOUNT` DECIMAL(10,0) NULL, `FOPERATIONDAY` DECIMAL(20,0) NULL, `FIP` VARCHAR(40) NULL, `FSENDDATE` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `FAPPVISITPOS` DECIMAL(4,0) NULL, `FVERSIONINFO` VARCHAR(30) NULL, `FUSERROLE` VARCHAR(500) NULL, `FSERVERADDITIONALINFO` VARCHAR(150) NULL);
3. 导入数据
load data local infile "D:/kingdee/T_USER_BEHAVIOR0803.txt" into TABLE t0803 fields terminated by ‘|‘;
4. 查看导入的数据有无乱码
select * from t0803 limit 5;
5. 若有乱码,则将该表删除
drop TABLE t0803;
原文:http://www.cnblogs.com/fuleying/p/4075290.html