I am currently trying to solve this problem in MySQL. I have MySQLdb installed. What is the best way to write a list in Python, e.g.
[1, 2, -1, -2]
to a column of a MySQL database table? I would like each consecutive entry of the list to be put into consecutive rows of a MySQL column. I can obviously run individual queries in a loop, but I was wondering if there is any better/faster way.
I am also willing to experiment with different data storage techniques if this isn't possible using MySQLdb. I am working with lists that contain several million entries each, and need to read/write quickly to some form of persistent storage that can store these many different lists as columns.
UPDATE: Thanks for your responses. After being led to search for execute many, I found this link, which had a useful example of executemany().