0

According to the documentation one two we should close connector each time we connect it.

import mysql.connector

cnx = mysql.connector.connect(**config)
# do some stuff
cnx.close()

Does it support with interface to do something like this?:

with mysql.connector.connect(**config):
    #do some stuff
Pavel Antspovich
  • 1,111
  • 1
  • 11
  • 27

0 Answers0