I need to create a file using NamedTemporaryFile
and download some data into it:
f = NamedTemporaryFile(suffix='.csv', delete=False)
s3.download_fileobj(bucket, f"{files_dir}/metadata/{table_name}.csv.gz", f)
After that I need to load data into mysql table using LOAD DATA INFILE
But I get an error:
File '/tmp/tmp00f3funu.csv' not found (OS errno 13 - Permission denied)
I suppose mysql root user doesn't have enough permissions to read temp file. This temp file has permissions to read only for owner of this file. What should I do to resolve this issue?