Can we import SQL from S3 bucket to AWS ec2 (instance)?

前端 未结 3 711
傲寒
傲寒 2021-01-25 12:47

I\'m trying to import a SQL file from S3 bucket to EC2 instance.

The SQL file is publicly accessible and with the help of mysql client installed in the instance I\'m ex

3条回答
  •  时光说笑
    2021-01-25 13:18

    What about not downloading the file, but directly pushing into the MySQL DB ?

    aws s3 cp s3://''/''.sql.gz - | gunzip | mysql
        --host=127.0.0.1 \
        --user='' \
        --password='' \
        --port=3306
    

    or,

    aws s3 cp s3://''/''.sql - | mysql
        --host=127.0.0.1 \
        --user='' \
        --password='' \
        --port=3306
    

提交回复
热议问题