with s2_connection:
with s2_connection.cursor() as cursor:
print(‘Is databases connected now:’, cursor.is_connected())
cursor.execute(query)
df = cursor.fetchall()
I tried to run the code above but it stops after 10 seconds and gives me below.
OperationalError: 2013: Lost connection to MySQL server during query
Does it have anything to do what the timeout setting? Thanks.
I have a python code that connects to Singlestore and runs a couple of queries:
conn = mysql.connector.connect(host=host, user=user, password=password, database=database)
if conn.is_connected():
try:
cursor = conn.cursor(buffered=True)
cursor.execute(‘DROP ALL FROM PLANCACHE’)
cursor.execute(queries[i])
res_fetchall = cursor.fetchall()
except Exception as e:
print(repr(e))
it connects to the database, and begins running (I can see in the active queries), however, after a few queries:
InterfaceError(2013, ‘2013: Lost connection to MySQL server during query’, None)
Retry after 5 sec
Connected
OperationalError(-1, ‘MySQL Connection not available.’, None)
Retry after 5 sec
Connected
OperationalError(-1, ‘MySQL Connection not available.’, None)
Retry after 5 sec
Connected
OperationalError(-1, ‘MySQL Connection not available.’, None)
Retry after 5 sec
Connected
OperationalError(-1, ‘MySQL Connection not available.’, None)
Retry after 5 sec
It loses the connection and even if I retry the connection it says it is not available.
Does anyone know what is happening?