title: Cannot Connect To RDS Instance Using Python pymysql Library
body: <p>I am attempting to connect to an RDS instance using Python's pymysql library.  Unfortunately I'm getting an exception back.</p>
  
  <p>Here is my Python code:</p>
  
  <pre class="lang-python prettyprint-override"><code>import pymysql
  
  #Connect
  connection = pymysql.connect(host='jdbc:mysql://dbname.url.us-east-1.rds.amazonaws.com/dbname',
                               port='3306',
                               user='username',
                               password='pass',
                               database='dbname')
  </code></pre>
  
  <p>Upon executing it, I receive the following exception:</p>
  
  <pre class="lang-python prettyprint-override"><code>Traceback (most recent call last):
    File "/path/to/file/test.py", line 8, in &lt;module&gt;
      database='treemigodb')
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pymysql/__init__.py", line 94, in Connect
      return Connection(*args, **kwargs)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", line 327, in __init__
      self.connect()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pymysql/connections.py", line 629, in connect
      raise exc
  pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'jdbc:mysql://dbname.url.us-east-1.rds.amazonaws.com/dbname' ([Errno 8] nodename nor servname provided, or not known)")
  </code></pre>
  
  <p>Here is what I've tried:</p>
  
  <ul>
  <li>I've opened up the security group on the AWS side to traffic.  I had previously performed this connection in Java, with success.  AWS is configured as it should be.</li>
  <li><p>I've seen in other examples that the <code>host</code> format tends to vary.  Therefore, I've tried:
  <code>jdbc:mysql://dbname.url.us-east-1.rds.amazonaws.com/dbname</code></p>
  
  <p><code>jdbc:mysql://url.us-east-1.rds.amazonaws.com/dbname</code></p>
  
  <p><code>jdbc:mysql://dbname.url.us-east-1.rds.amazonaws.com/</code></p>
  
  <p><code>jdbc:mysql://url.us-east-1.rds.amazonaws.com/</code></p>
  
  <p><code>dbname.url.us-east-1.rds.amazonaws.com/dbname</code></p>
  
  <p><code>url.us-east-1.rds.amazonaws.com/dbname</code></p>
  
  <p><code>dbname.url.us-east-1.rds.amazonaws.com/</code></p></li>
  </ul>
  
  <p>Is there some potential setup that I could be missing?  I've double-checked that every other parameter matches.</p>