在日常运维中,会经常遇到将文件中数据导入到数据库中,如果是.sql文件,直接采用source方式即可;如果是.csv、.txt文件,可以采用 load data 方式。...这两种方式都十分熟悉,这里说一种特殊情况:
需求很简单,有如下txt文件需要将数据导入库表对应字段中
文件已转换到unix,字符类型utf8,跟数据库一致,无乱码
?.../day.txt' into table day(date,division_id,division_name,pur_first_dept_cd,pur_first_dept_name,type,cost...ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL.../day.txt' into table day(date,division_id,division_name,pur_first_dept_cd,pur_first_dept_name,type,cost