一、使用load data infile命令
load data[local] infile file_name into table table_name [option];
举例:
load data infile 'c:/t_dept.txt' into table t_dept
fields terminated by '\、'
optionally enclosed by '\"'
terminated by '\r\n';
二、使用mysqlimport命令
mysqlimport -u root -pPassword[--local] dbname file_name[option]
举例:
mysqlimport -u root -proot company c:\t_dept.txt
"--fields-terminated-by=、"
"--fields-optionally-enclosed-by=""
"--lines-terminated-by=\r\n"