Exporting mysql data to csv file on command line.
mysql --comments -uUSER -p -hHOST DBNAME -e "SELECT * FROM tablename INTO OUTFILE '/tmp/filename.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n';"
Importing mysql data from csv file.
mysql --comments -uUSER -p -hHOST DBNAME -e "LOAD DATA LOCAL INFILE '/tmp/filename.csv' INTO TABLE tablename FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n';"
'IT_컴퓨터_코딩_개발' 카테고리의 다른 글
Android keep Screen On (0) | 2016.10.07 |
---|---|
Export DB to SQL query using mysqldump (0) | 2016.10.05 |
유니티 구매 가격 (0) | 2016.09.29 |
UE4 언리얼 엔진 비용 (0) | 2016.09.29 |
[CocosCreator] HelloWorld : ButtonScript.js Example (0) | 2016.07.20 |