You can use the mysql LOAD_FILE function in combination with a little shellscript to do this, I think.
Unconfirmed code follows:
#!/bin/bash
if [ -z $1 ]
then
echo "usage: insert.sh <filename>"
else
SQL="INSERT INTO file_table (blob_column, filename) VALUES(LOAD_FILE('$1'), '$1')"
echo "$SQL" > /tmp/insert.sql
cat /tmp/insert.sql | mysql -u user -p -h localhost db
fi
And you can use it as follows:
<prompt>./insert.sh /full/path/to/file
, tempfile, . , LOAD_FILE() FILE MySQL .