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.