title: MySQL remote access trouble?
body: <p>I have a database set up on a godaddy server. It is configured to allow remote access, and there are a couple of websites I'm running which need to access this data. It works when accessed from another godaddy site, and I can connect from my development environment both at work and home. We recently set up hosting with mydomain.com.</p>
  
  <p>Here is the code block that triggered it:</p>
  
  <pre><code>function connect(){
      $servername = "XX.XX.XXX.XX";
      $dbusername = "databaseusername";
      $dbpassword = "mahpassword";
      $dbname = "databasename";
      try{
        $newMysql = new PDO("mysql:host=".$servername.";dbname=".$dbname, $dbusername, $dbpassword);
      }
          catch(PDOException $e){
          echo 'connection Failed: '. $e-&gt;getMessage();
          die;
      }
  }
  </code></pre>
  
  <p>and now I'm getting this error message on the new site:</p>
  
  <pre><code>connection Failed: SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'XX.XX.XXX.XX' (111)
  </code></pre>
  
  <p>The only problems I can think of is that either for some reason there are a limited number of IP addresses the MySQL database will connect to by default (which seems squirrely), I'm getting blocked by a firewall on the MySQL server (again.. doesn't make sense to me), or there is some setting on the mydomain hosting server disallowing remote requests (?)</p>
  
  <p>I'm new to this kind of thing, so I'm open to any suggestions. I could probably just set up another database on the new site, but I don't want the hassle of keeping them synchronized if I don't need to. What might be wrong? Are there any workarounds?</p>
  
  <p>[edit]
  connected to remote database via console <code>(mysql -h XX.XX.XXX.XX ...)</code>, the privileges were found under the information_schema database, a quick <code>select * from SCHEMA_PRIVILEGES</code> and <code>select * from USER_PRIVILEGES</code> shows that <code>'databaseusername'@'%'</code> has sufficient privileges. Not that it helped me any, but maybe it'll help someone down the road.
  [/edit]</p>