title: Moving MySQL from localhost to remote server
body: <p>I’ve just finished writing a website which is working very well on my local server (xampp).
  The following is my connection database definitions for the local server:</p>
  
  <pre><code>&lt;?php
    $host="localhost";
    $username="root";
    $password="1234";
    $db_name="partnership";
  
    mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
    mysql_select_db("$db_name")or die("cannot select DB");
  ?&gt;
  </code></pre>
  
  <p>I’ve loaded my files successfully and put them on the remote server (www.mydomain.com) and I’ve created the relevant database ‘partnership’ (successfully imported all Tables from phpMySQL local server to the remote server).</p>
  
  <p>I can view the website  (www.mydomain.com) but with no connection to the database (MySQL).
  The error message is of course "cannot connect".</p>
  
  <p>I’ve changed <code>$host="localhost"</code> to <code>$host=”www.mydomain.com”</code> but still getting the same error message.</p>
  
  <p>Any assistance on the above issue would be greatly appreciated.</p>