title: PHP: connect with external mysql database
body: <p>I want to connect with external database using <code>PHP</code>. But, it gives this error</p>
  
  <pre><code>Warning: mysql_connect(): Can't connect to MySQL server on 'SERVER_IP_ADDRESS' (110) in /home/&lt;username&gt;/public_html/index.php on line 7
  Can't connect to MySQL server on 'SERVER_IP_ADDRESS' (110)
  </code></pre>
  
  <p>Here is my code.</p>
  
  <pre><code>define("_CONFIG_DB_HOST", "SERVER_IP_ADDRESS");  /* database host name */
  define("_CONFIG_DB_NAME", "DATABASE_NAME");    /* database name */
  define("_CONFIG_DB_USER", "DATABASE_USERNAME");    /* database username */
  define("_CONFIG_DB_PASS", "DATABASE_PASSWORD");    /* database password */
  
  
  $con = mysql_connect(_CONFIG_DB_HOST,_CONFIG_DB_USER,_CONFIG_DB_PASS) or die(mysql_error());
  mysql_select_db(_CONFIG_DB_NAME,$con) or die(mysql_error());
  </code></pre>
  
  <p>I've also added entry for <code>Remote Database Access Hosts</code> in Host Server</p>
  
  <p>Please guide me if I'm doing anything wrong.</p>