CSV 파일 mysql table 에 insert 하기
마스터욱
0
27
0
0
2017-07-10 11:50:27
mysql -uroot -p --local-infile DB명 -e "LOAD DATA LOCAL INFILE '/www/xxx.csv' INTO TABLE 삽입테이블명 FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';"
mysql 접속해서 넣는 방법
LOAD DATA LOCAL INFILE '/www/xxx.csv' INTO TABLE 삽입테이블명 FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
2017-07-20일자 업데이트
- 더블쿼테이션 에러 해결
LOAD DATA INFILE '/www/sql/xxx.csv'
INTO TABLE 삽입테이블명
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY ''
LINES TERMINATED BY '\n'
IGNORE 1 LINES;