Skip to content

Instantly share code, notes, and snippets.

@rolfen
rolfen / MySqlExportBlob.md
Last active May 22, 2019 10:41
Exporting multiple blobs/images from an SQL database

Exporting multiple blobs from an SQL database.

This is tested for MySQL with Linux or OSX

I was in a situation where I had images saved into an SQL table, as "blobs" and needed to export them into proper jpg files.

This relies on the SQL syntax SELECT INTO DUMPFILE. However this command can only export one row at a time.

1. Get the IDs of the rows we want to export