title: Django shell(plus) timeout on remote database connection
body: <p>I'm migrating a legacy db into a bunch of models I have running locally. I connected to the legacy db and ran inspectdb to recreate the models. Now I'm writing functions to pair the numerous fields to their equivalents in new models. I've been using shell_plus, and the first minute or so of queries go great, but my connections keep timing out
  with the following:</p>
  
  <pre><code>RemoteArticle.objects.using("remote_mysql").all()    
  django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query')
  </code></pre>
  
  <p>Is there a command I can run to either a) reconnect to the db before running a query (so I don't have to reopen shell_plus), or ideally b) make it so that all of my queries automatically reconnect each time I run them?</p>
  
  <p>I've seen timeout issues on other platforms, but I wasn't sure if Django had a built-in way of handling such things. </p>
  
  <p>Thanks!</p>