I am trying to find a way to reuse the DB connection across multiple executions. But upon executing the second db.cursor() I get error:
mysql.connector.errors.OperationalError: MySQL Connection not available.
import mysql.connector
db = mysql.connector.connect(host="***", user="***", password="***", database="***")
db.autocommit = True
cursor = db.cursor()
cursor.execute("call procedure1();")
rows1 = cursor.fetchall()
cursor = db.cursor()
cursor.execute("call procedure2()")
rows2 = cursor.fetchall()