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

前端 未结 3 721
傲寒
傲寒 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:13

    You can't reliably do this in one step. You have to download the file, then load the local (downloaded) copy into MySQL.

    $ wget https://s3-ap-southeast-1.amazonaws.com/{sql-file} -O some-local-filename.sql
    
    $ mysql [options]
    
    mysql> source some-local-filename.sql
    

提交回复
热议问题