title: Cannot connect to remote MySQL database hosted on AWS Lightsail machine (61)/(111)
body: <p>I am attempting to host a MySQL database on an AWS server and allow it to be queried from other machines (for the purpose of an app/website being developed).</p>
  
  <p>I am a bit new to server-side administration so please bear with me.</p>
  
  <p>I have no problem accessing and querying from mysql on the machine locally after I ssh in, however if I try to connect from my local machine via:</p>
  
  <pre><code>    mysql -u &lt;username&gt; -p -h &lt;domain&gt;
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>    ERROR 2003 (HY000): Can't connect to MySQL server on &lt;domain&gt; (111)
  </code></pre>
  
  <p>Trying it on another machine altogether gives the same error but with (61) instead of (111). I have already created my username and allowed access from any host via:</p>
  
  <pre><code>    GRANT ALL PRIVLEGES ON &lt;table name&gt; TO 'user'@'%' IDENTIFIED BY &lt;password&gt;
  </code></pre>
  
  <p>I have also made sure that port 3306 is open and changed the bind-address to 0.0.0.0 in the my.cnf file.</p>
  
  <p>Any help would be appreciated. Thank you!</p>