title: "Can't connect to MySQL server in lambda
body: <pre><code>import pymysql
  from botocore.vendored import requests
  def lambda_handler(event,context):
        conn=pymysql.connect (host ="rootrestdatabase.cd6kbmibgfod.ap-south-1.rds.amazonaws.com", user="****" , passwd="*****",db="restawsdatabase")
  </code></pre>
  
  <p>i want to connect rds in lambda . but i gor error like </p>
  
  <pre><code>"errorMessage": "(2003, \"Can't connect to MySQL server on 'rootrestdatabase.cd6kbmibgfod.ap-south-1.rds.amazonaws.com' (timed out)\")",
    "errorType": "OperationalError",
    "stackTrace": [
      [
  </code></pre>
  
  <p>i have tried it in local machine it works fine but when i deploy code in lamba it didnt worked. also both lambda function and rds are in same region. what shoud i have to do?</p>