Insert Binary Data (BLOB) From the Command Line
Posted on 2002-04-19
I have a binary data file (A Quicktime Movie, to be precise) that I would like to load into a field in an MySQL table. I can do this easily in PHP, but this time I want to do it from the command line.
What I want is, and this is pseudocode, something like:
INSERT INTO myTable (binary_field, title) VALUES (read_file('movie.mov'), 'My Movie');
Is there anything like this? I want the actual binary contents of the file to go into the BLOB, not the filename. I'm probably missing something very simple.