If you have stored binary data from a file in a BLOB column within a table and want to reconstitute it into a file, use the INTO DUMPFILE clause of the SELECT statement. INTO DUMPFILE writes data from a query directly to a file without modifying it in any way.
INTO DUMPFILE only works with SELECT statements that return a single row. If multiple columns are in the row, they are concatenated together without any separator. For example,
SELECT 1, 2, 3, 4 INTO DUMPFILE '/tmp/numbers';
creates a file that contains 1234.