title: pymysql - Can't connect to MySQL server "Temporary failure" in name resolution
body: <p>I'm trying to connect to MySQL database that is hosted on our AWS-RDS instance through Python using pymysql. I am able to connect and retrieve data successfully but the connection intermittently drops and throws error 
  <code>"pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '&lt;my_hostname&gt;' ([Errno -3] Temporary failure in name resolution)")"</code></p>
  
  <p>Please note that I'm using Python's multiprocessing library to run pool processes. All the threads created by this process are trying to access database. The process runs for a while and then loses connection to MySQL, at random intervals for different runs.</p>
  
  <ul>
  <li>Tried putting RDS url directly in the client code</li>
  <li>Tried opening separate cursors for separate DB queries made within the code.</li>
  </ul>
  
  <pre class="lang-py prettyprint-override"><code>return list(tqdm(pool.imap(createMetricDataJson,res), total=len(res)))
  </code></pre>
  
  <p>createMetricDataJson method calls database to query different tables.</p>