I'm trying to UPDATE some BLOB images in a database with the python-mysqldb package but i always get this error:
ValueError: unsupported format character ',' (0x2c) at index 64
I've successfully added the images some time ago with the execute substitution tools for example like this:
Set up connection to db:
db = MySQLdb.connect( host="127.0.0.1", port=0815, user="javert", passwd="ureyes", db="some_db")
cur = db.cursor()
read image files:
images = [ open( image_file, 'rb') for image_file in folder ]
image1, ..., image6 = images
insert images:
command = """INSERT INTO database_table (column1, ..., column6) VALUES (%s,%s,%s,%s,%s,%s)"""
cur.execute( command, args=( image1, ..., image6))
db.commit()
Now I've replaced the insert command with the following and get the described error:
"""UPDATE database_table SET column1=%s, column2=%s, column3=%s, column4=s%, column5=%s, column6=%s WHERE id=table_row_id"""
Thank You for your help!
pyodbc?pyodbcis compatible with more libraries and does not need mysql dlls for its installation. I now noticed that mysql-python was updated more recently, so I don't know what's better