I have script in python where I use MySQLdb connector, but on server MySQLdb isn't installed, so I need change connector. I have example class:
class Foo:
def __init__(self, config):
self.logger = logging.getLogger("Foo")
self.db = MySQLdb.connect(host=config["host"],user=config["user"], passwd=config["passwd"], db=config["db"])
def get_something(self):
cursor=self.db.cursor()
cursor.execute("Select ...")
for row in cursor:
self.logger.debug(row)
yield(row)
f = Foo(config)
f.get_something()
When I use MySQLdb connector it works. In this case python reads all records and store in memory.
But when I change connector to mysql.connector
script prints some records and raise error:
mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL server during query
This is modified class:
class Foo:
def __init__(self, config):
self.logger = logging.getLogger("Foo")
self.db = mysql.connector.connect(host=config["host"],user=config["user"], passwd=config["passwd"], db=config["db"])
def get_something(self):
cursor=self.db.cursor()
cursor.execute("Select ...")
for row in cursor:
self.logger.debug(row)
yield(row)
f = Foo(config)
f.get_something()
I try run query:
self.db.cursor().execute("SET GLOBAL max_allowed_packet=1073741824")
But I have error:
mysql.connector.errors.ProgrammingError: 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation
Is it possible to repair this error? I haven't root access to change privileges and I haven't access to install MySQLdb on server.