Category Archives: Python

Python RuntimeError: generator raised StopIteration

MySQL Connector error generator raised stopiteration error in Python

Error: Error caused in executing with multi=true parameter

result = cursor.execute(query, params, multi=True)
for r in result: # causes the error

OR 
cursors = cur.execute(operation="select * from table1;select * from table2;",multi=True)
for cur in cursors: # <--- this line causes error with python 3.7 and deprecation warning with python 3.6
	cur.fetchall()

Solution:

It is the bug that is fixed in last MySQL connector. You need to update the later MySQL connector with PIP command. It is fixed in MySQL Connector/Python in 8.0.13 version with python 3.7 version.

Install the new upgraded connector will be fixed the issue

pip install mysql-connector-python