[英]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.谢谢。
LOAD DATA FROM S3 's3://mybucket/data.txt'
INTO TABLE table1
(column1, column2)
SET column3 = CURRENT_TIMESTAMP;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.