是否可以将SQL从S3存储桶导入到AWS ec2(实例)? [英] Can we import SQL from S3 bucket to AWS ec2 (instance)?

查看:151
本文介绍了是否可以将SQL从S3存储桶导入到AWS ec2(实例)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将SQL文件从S3存储桶导入EC2实例。

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

该SQL文件是可公开访问的,并且在实例中安装了mysql客户端的情况下,我正在执行以下命令。

The SQL file is publicly accessible and with the help of mysql client installed in the instance I'm executing the following command.

mysql> source https://s3-ap-southeast-1.amazonaws.com/{sql-file}

当我这样做时,出现以下错误。

When I do I'm getting the following error.

ERROR:
Failed to open file 'https://s3-ap-southeast-1.amazonaws.com/{sql-file}', error: 2

我不是专家,但是我可以尝试吗?

I'm not an expert, but is it possible what I'm trying?

推荐答案

您无法可靠地做到这一步。您必须下载文件,然后将本地(下载的)副本加载到MySQL中。

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

这篇关于是否可以将SQL从S3存储桶导入到AWS ec2(实例)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆