title: How to connect to a MySQL database on another domain?
body: <p>Basically, I need to connect to another database on a different domain.</p>
  
  <p>For example, I'll use <code>domain1</code> and the domain that needs to connect, and <code>domain2</code> as the domain that has the database.</p>
  
  <p>I have tried:</p>
  
  <pre><code>mysql_connect("domain2.com.au", "user", "pass") or die(mysql_error());
  
  mysql_select_db("database") or die(mysql_error());
  </code></pre>
  
  <p>Although, that refused to work.</p>
  
  <p>I looked for quite some time online to find a solution, and many of them involved logging into <code>SSH</code> which I am not familiar with and I would like to avoid this method.</p>
  
  <hr>
  
  <p>If needed, here is my error (some things modified for privacy):</p>
  
  <pre><code>Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user'@'host.com' (using password: YES) in /php/2012.php on line 270
  Access denied for user 'user'@'host.com' (using password: YES)
  </code></pre>
  
  <hr>
  
  <p>Is there an option that I must change within my database to allow access from other domains? If so, where exactly is this?</p>
  
  <p>Is there a port that I need to connect to such as <code>domain2.com.au:3307</code>?</p>