简体   繁体   English

MySQL Aurora 和 AWS S3:需要 MySQL 的“加载数据”的替代方法来从 S3 加载文档数据

[英]MySQL Aurora and AWS S3: Need an alternate way of MySQL's "LOAD DATA" for loading document data from S3

I need to import data from files stored in S3 into an MySQL Aurora db.我需要将存储在 S3 中的文件中的数据导入到 MySQL Aurora 数据库中。

I have Eventbridge setup so when the file is added to S3 it fires an event that calls a lambda.我有 Eventbridge 设置,所以当文件添加到 S3 时,它会触发一个调用 lambda 的事件。

The lambda needs to import the file data into MySQL. The MySQL "LOAD DATA FROM S3" feature would be great for this..... but.... you will get the error: This command is not supported in the prepared statement protocol yet . lambda 需要将文件数据导入到 MySQL。MySQL 的“从 S3 加载数据”功能非常适合这个......但是......你会得到错误: This command is not supported in the prepared statement protocol yet

LOAD DATA has a lot of limitations such as this, it cannot be be in a stored procedure, cannot be in dynamic SQL (really needed here). LOAD DATA 有很多限制,例如,它不能在存储过程中,不能在动态 SQL 中(这里确实需要)。 I cannot find a hack work-around for this and need an alternate way to import data directly from S3 to MySQL. I don't want to move the data from S3 to Lambda to MySQL as that extra step in the middle adds a lot of exposure for failure.我找不到解决此问题的方法,需要另一种方法将数据直接从 S3 导入到 MySQL。我不想将数据从 S3 移动到 Lambda 到 MySQL,因为中间的额外步骤增加了很多暴露失败。

Does anyone know any good ideas (and even not so good) for moving data from S3 to MySQL Aurora?有谁知道将数据从 S3 移动到 MySQL Aurora 的任何好主意(甚至不太好)?

Thanks.谢谢。

  1. Check whether the user has permission to import data, which requires AWS_LOAD_S3_ACCESS permission检查用户是否有导入数据的权限,需要AWS_LOAD_S3_ACCESS权限
  2. Examples of import statements can be referred to as follows: import语句的例子可以参考如下:
LOAD DATA FROM S3 's3://mybucket/data.txt'
     INTO TABLE table1
     (column1, column2)
     SET column3 = CURRENT_TIMESTAMP;
  1. For more detailed information, please refer to https://docs.amazonaws.cn/en_us/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Integrating.LoadFromS3.html更多详细信息请参考https://docs.amazonaws.cn/en_us/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Integrating.LoadFromS3.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 AWS Glue 将数据从 S3 加载到 Aurora Serverless - Load data from S3 into Aurora Serverless using AWS Glue 将 S3 数据加载到 AWS SageMaker Notebook - Load S3 Data into AWS SageMaker Notebook 如何使用带有制表符分隔符的“aws_s3.query_export_to_s3”从 RDS/Aurora 导出到 S3? - How to export to S3 from RDS / Aurora using `aws_s3.query_export_to_s3` with a tab delimiter? 我可以直接从 S3 存储桶加载数据以检测 Java 的 AWS SDK 中的关键短语吗? - Can I load data directly from a S3 Bucket for detecting key phrases in the AWS SDK for Java? 将不同来源的数据流式传输到 AWS S3 - Streaming Data From different Sources to AWS S3 AWS mirgate 数据从 MongoDB 到 DynamoDB/S3/Redshift - AWS mirgate data from MongoDB to DynamoDB/S3/Redshift 如何将数据提取到 AWS S3 - How to Ingest Data into AWS S3 AWS Lambda - 将数据从 s3 传输到 redshift - AWS Lambda - transfer data from s3 to redshift KeyError:尝试将数据从 S3 加载到 Sagemaker 时出现“ETag” - KeyError: 'ETag' while trying to load data from S3 to Sagemaker 更新存储在 AWS S3 中的数据的模式/数据的策略 - Strategy for Updating Schema/Data of Data Stored in AWS S3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM