I'm running a task that need to be connected to a mysql database via SSH tunel. I'm getting therefore the MySQLdb._exceptions.OperationalError: (4031, 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.') error. At my local machine I could easily fix this by adding a "hearbeat" function that pushes some dummy sql request and reconnects if it fails. However, at Pythonanywhere this doesn't seem to work, because I get a MySQLdb._exceptions.OperationalError: (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 11") error at the try to reconnect. Could you help me how to fix this issue permanently? Many thanks in advance!