title: mysql_connect(): Connection refused
body: <p>I was just wondering if it was possible for certain databases to block SQL accesses through <code>mysql_connect</code>. I recently downloaded XAmpp and created a SQL database using my own computer as a local host and wrote a PHP file that accessed that database.</p>
  
  <p>However, when I tried to change the username and host settings so that Xampp would run the PHP files that would then connect to the external SQL database of a free hosting site that I'm trying to use (biz.co.nf), I got the following error message: </p>
  
  <blockquote>
    <p>Warning: mysql_connect(): Connection refused in /Applications/XAMPP/xamppfiles/htdocs/...</p>
  </blockquote>
  
  <p>Right now I'm thinking either: </p>
  
  <ol>
  <li><p>My login credentials to that database are incorrect, or </p></li>
  <li><p>Somehow the host blocks SQL accesses from external users, but if I were to load my php code into the server using FileZilla, it should work okay? </p></li>
  </ol>
  
  <p>Please let me know if this is the case.</p>
  
  <p>I'm also fairly certain I have the right login credentials.</p>
  
  <p>Here's what I have: </p>
  
  <pre><code>$host = "fdb13.biz.nf";
  $username = "1764941_login";
  $password = ________;
  $db_name = "1764941_Login";!
  $tbl_name = "Members";
  
  //Connect to server
  mysql_connect($host, $username, $password)or die("Cannot Connect!");
  mysql_select_db($db_name)or die("Cannot select Database");
  </code></pre>
  
  <p>with my server settings according to my website...
  <img src="https://i.stack.imgur.com/WqEhK.png" alt="Settings"></p>
  
  <p>Of course, I omitted my password.</p>