Query parameter for Cursor.executemany
should sequence of sequences.
Use `int(.., 16) to convert hexadecimal string to int.
>>> int('9e107d9d372bb6826bd81d3542a419d6', 16)
210103647840849757586127012022035159510L
>>> hex(int('9e107d9d372bb6826bd81d3542a419d6', 16))
'0x9e107d9d372bb6826bd81d3542a419d6L'
How about using list comprehension?
md5list = ['9e107d9d372bb6826bd81d3542a419d6',
'e4d909c290d0fb1ca068ffaddf22cbd0']
params = [[int(h, 16)] for h in md5list]
cursor.executemany("insert into hashes (md5) values (%s)", params)