Skip to content

Instantly share code, notes, and snippets.

@caffeinetiger
Last active April 18, 2022 18:30
Show Gist options
  • Save caffeinetiger/8b6a3761813c9d946815310354bebe8f to your computer and use it in GitHub Desktop.
Save caffeinetiger/8b6a3761813c9d946815310354bebe8f to your computer and use it in GitHub Desktop.
-- Grant statements
GRANT LOAD FROM S3 ON *.* TO 'username'@'%';
GRANT SELECT INTO S3 ON *.* TO 'username'@'%';
-- Replace with appropriate Schema, Table, AWS Region Code, and S3 URI
SELECT * FROM some-schema.some-table INTO OUTFILE S3 's3-some-region-code://some-buck-name/some-prefix' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment