I have some input which is a string containing more than one MySQL queries, such as USE some_db; SELECT * FROM some_table;. When I store this string as s and run cursor.execute(s), it prints out 0L and when I do cursor.fetchall() it returns an empty tuple. It does not raise any exception, but it does not work either. When I split the string into two queries and open a cursor for each and execute, it works, but correctly splitting a string into queries is not easy, especially when there are comments. Is there a way to avoid splitting and execute the whole string of multiple queries? Or this there a good library to split a string of multiple queries into strings with one query each?
Thanks!