title: AWS RDS and PDO don't work SQLSTATE[HY000] [2002]
body: <p>I created my MySQL 5.7 database with RDS.</p>
  
  <p>Before, I connected with PDO to a database on the same server as the web server. Server that is not an EC2. All worked well.</p>
  
  <p>I create my RDS database and modify my class for the DB with the AWS id and now, it doesn't work any more.</p>
  
  <p>The connection information seems correct because I can connect to it from MySQL Workbench.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$_HOST = 'xxxxxxxxx.us-east-2.rds.amazonaws.com';
  $_PORT = 3306;
  $_DBNAME = 'xxxxx';
  $_USER = 'xxxx';
  $_PASS = 'xxxx';
  
  $connexionString = "mysql:host={$_HOST};port={$_PORT};dbname={$_DBNAME}";
  
  self::$_instance = new PDO($connexionString, $_USER, $_PASS);
  </code></pre>
  
  <p>And here is the error message:</p>
  
  <blockquote>
    <p>PDOException: SQLSTATE[HY000] [2002] A connection attempt failed
    because the connected party did not properly respond after a period of
    time, or established connection failed because connected host has
    failed to respond.</p>
  </blockquote>
  
  <p>What do you think is going on?</p>