title: AWS Python Lambda timeout when trying to access MySQL
body: <p>I'm trying to access our servers MySQL database (Not AWS RDS) with:</p>
  
  <pre><code>def lambda_handler(event, context):
      try:
          conn = pymysql.connect("mySite.com", user="admin", passwd="pass",  connect_timeout=5)
  </code></pre>
  
  <p>and I'm getting return error:</p>
  
  <pre><code>Response:
  {
    "errorMessage": "xxxxxxxxxxxxxxxxxxxxxxxxx Task timed out after 3.00 seconds"
  }
  </code></pre>
  
  <p>I've set up my roles with the <code>AWSLambdaVPCAccessExecutionRole</code> and <code>WSLambdaRole</code> and set up a default VPC network with subnets and security groups:</p>
  
  <pre><code>Security group ID: sg-xxxxxxxx
  Ports: All
  Destination: 0.0.0.0/0  
  </code></pre>
  
  <p>Is there something I'm forgetting? I tested this with a RDS and I'm able to connect to the DB it's just when I try an external DB it's timing out. </p>
  
  <p><a href="https://i.stack.imgur.com/8GSQf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8GSQf.png" alt="enter image description here"></a></p>