How to insert / retrieve a file stored as a BLOB in a MySQL db using python
- by Phage
I want to write a python script that populates a database with some information. One of the columns in my table is a BLOB that I would like to save a file to for each entry.
How can I read the file (binary) and insert it into the DB using python? Likewise, how can I retrieve it and write that file back to some arbitrary location on the hard drive?