DBMS/MySQL

Loading data from an Amazon Aurora MySQL DB Cluster into Text Files in an Amazon S3 Bucket

Temporary backups 2021. 4. 8. 02:13
반응형

GRANT LOAD FROM S3 ON *.* TO `root`@`%`;

 

 

LOAD DATA FROM S3 MANIFEST 's3://aprdsflip01/aurora_test3.manifest' 

    INTO TABLE `sbtest`.`TB_CM_EMP`

    FIELDS TERMINATED BY ','

    LINES TERMINATED BY '\n'

    SET MOD_DATE = NOW();

 

select * from sbtest.TB_CM_EMP;

 

TRUNCATE sbtest.TB_CM_EMP;

 

 

LOAD DATA FROM S3 PREFIX 's3://aprdsflip01/aurora_test3.part' 

    INTO TABLE `sbtest`.`TB_CM_EMP`

    FIELDS TERMINATED BY ','

    LINES TERMINATED BY '\n'

 (EMP_NO,TASK_CD,EMP_NM,EMP_ENGNM,BIR_YMD,EMP_IMG,GENDER,EMAIL,HPNO,TELNO,DEPT_CD,RANK_CD,POS_CD,EMP_TYPE,WORK_YN,HIRE_YMD,RETIRE_YMD,MOD_DATE,MOD_USER)

    SET MOD_DATE = NOW();

 

 

 

select * from sbtest.TB_CM_EMP;

 

TRUNCATE sbtest.TB_CM_EMP;

반응형