engine = sqlalchemy.engine.create_engine('mysql+pymysql://localhost')
while True:
    connection = engine.connect()
result = connection.execute('SELECT 1')
print(result.fetchone())
connection.close()
sqlalchemy + MySQL connection timeouts