title: mysql_connect access denied error when trying to access remote database
body: <p>I'm trying to connect to a remote database.  Here's my code:-</p>
  <pre><code>php $con = mysql_connect(&quot;2toria.com&quot;,&quot;username&quot;,&quot;password&quot;); if (!$con)   {   die('Could not connect: ' . mysql_error());   }
  
  mysql_select_db(&quot;myTable&quot;, $con);
  
  $result = mysql_query(&quot;SELECT * FROM Contestants&quot;);
  
  while($row = mysql_fetch_array($result))   {   echo $row['Name'];   echo &quot;&lt;br /&gt;&quot;;   }
  
  mysql_close($con);
  </code></pre>
  <p>The database, table, username and password names are all correct (I've changed them here for obvious reasons), but I'm getting the following error:-</p>
  <blockquote>
  <p>Warning: mysql_connect() [function.mysql-connect]: Access denied for
  user 'username'@'bluechip6.ukhost4u.com' (using password: YES) in
  /home/toriaco/public_html/bigbro/index.php on line 9 Could not
  connect: Access denied for user 'username'@'bluechip6.ukhost4u.com'
  (using password: YES)**</p>
  </blockquote>