So basically I have this list :
L1 = ['hel-lo', 'world123', 'bye', 'python']
I want to insert this list in my MySQL table, as follow :
+-------------------------+
| words |
+-------------------------+
| hel-lo |
| world123 |
| bye |
| python |
+-------------------------+
In reality, my list is composed of about 1000 elements. I tried many things which I found on StackOverflow, but nothing is working. (It seems that the elements are trying to be insert with this format "['string']").
Last solution I tried :
values = [list([item]) for item in L1]
cursor.executemany(u"INSERT INTO `table`(`data`) VALUES %s", values)
Which returns this error :
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''hel-lo')' at line 1
Any advices are welcomed !