title: Connecting to MySQL on another IP (server), PHP
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1935314/connecting-to-remote-mysql-server-using-php">Connecting to remote MySQL server using PHP</a>  </p>
  </blockquote>
  
  
  
  <p>I can successfully connect to a database using localhost while the code is on the server where the MySQL is.</p>
  
  <p>I want to connect to the same MySQL server, but from another IP:</p>
  
  <pre><code>mysql_connect("localhost","root","&lt;password&gt;");
  mysql_select_db("db name");
  </code></pre>
  
  <p>But say my new IP is 12.123.123.12</p>
  
  <p>I tried:</p>
  
  <pre><code>mysql_connect("12.123.123.12","root","&lt;password&gt;");
  mysql_select_db("db name");
  </code></pre>
  
  <p>What am I doing wrong?</p>