title: 1130 Host 'amazon-ec2-ip' is not allowed to connect to this MySQL server
body: <p>I am facing a problem in accessing the mysql DB on one of my Amazon EC2 servers from another EC2 server. I read through various articles regarding providing appropriate permissions for mysql to be accessed from external IP addresses, and here are the steps that I followed:</p>
  
  <ol>
  <li>Opened port 3306 on my host EC2 instance to allow for external Mysql connection.</li>
  <li>In the file /etc/mysql/my.cnf, changed the "bind-address" from "127.0.0.1" to "0.0.0.0".</li>
  <li>Opened mysql using root, and executed the following command:
  GRANT ALL PRIVILEGES on <em>.</em> to worker@'ec2-ip-address' IDENTIFIED BY 'password';</li>
  </ol>
  
  <p>As per all the blogs/articles that I read, this should have solved the issue, but i keep getting the following error:</p>
  
  <pre><code>1130  Host 'amazon-ec2-ip' is not allowed to connect to this MySQL server
  </code></pre>
  
  <p>The ip address I was providing for the EC2 instance was an elastic IP that gets generated when you create an instance. To verify whether the issue is specific to EC2, I tried executing the command "3" for a different "static ip address". Now, this worked for me (i.e. I was able to login to the mysql host from that remote server), so it is sure that the above steps are correct.</p>
  
  <p>Why is the Amazon EC2 ip address not working?</p>