Running into an issue with two docker containers, everything works fine writing to the MySQL DB, but I'm getting occasional errors in the MySQL log:
2020-09-18 17:03:02 21 [Warning] Aborted connection 21 to db: 'database' user: 'dbuser' host: '172.18.0.5' (Got an error reading communication packets)
2020-09-18 17:05:02 47 [Warning] Aborted connection 47 to db: 'database' user: 'dbuser' host: '172.18.0.5' (Got an error reading communication packets)
2020-09-18 17:08:02 49 [Warning] Aborted connection 49 to db: 'database' user: 'dbuser' host: '172.18.0.5' (Got an error reading communication packets)
2020-09-18 17:08:02 48 [Warning] Aborted connection 48 to db: 'database' user: 'dbuser' host: '172.18.0.5' (Got an error reading communication packets)
2020-09-18 17:08:02 50 [Warning] Aborted connection 50 to db: 'database' user: 'dbuser' host: '172.18.0.5' (Got an error reading communication packets)
2020-09-18 17:10:03 52 [Warning] Aborted connection 52 to db: 'database' user: 'dbuser' host: '172.18.0.5' (Got an error reading communication packets)
2020-09-18 17:10:03 51 [Warning] Aborted connection 51 to db: 'database' user: 'dbuser' host: '172.18.0.5' (Got an error reading communication packets)
My Python code that's writing to the DB is:
mydb = mysql.connector.connect(
host="mysqlprd",
user="dbuser",
passwd="password",
database="database"
)
mycursor = mydb.cursor()
sql = "INSERT INTO filldbstats VALUES .....
mycursor.executemany(sql,val)
mydb.commit()
pass
Is there a way to pass a timeout in the MySQL part of the python script, or is it something that needs to be set on the DB side?
Thanks