title: MySQL Connection String Using PHP
body: <p>I am trying to connect to the database that is hosted on my server through my local machine. </p>
  
  <p>my server has cPanel 11, and it is a typical shared server, powered by CentOS, PHP and MySQL installed. </p>
  
  <p>to be precise i am holding the reseller account in the same server. i want to access the database between different accounts or domains. </p>
  
  <p>in MySQL connection String i tried defining the domain name, and it isn't working. here is what i tried. </p>
  
  <pre><code>&lt;?php
  $link = mysql_connect('mydomain.com', 'mysql_user', 'mysql_password');
  if (!$link) {
      die('Could not connect: ' . mysql_error());
  }
  echo 'Connected successfully';
  mysql_close($link);
  ?&gt;
  </code></pre>
  
  <p>this is giving the following error</p>
  
  <pre><code>Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://bhatkalnews.com:3306) in C:\wamp\www\test\conn.php on line 4
  
  Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\test\conn.php on line 4
  
  Fatal error: Maximum execution time of 60 seconds exceeded in C:\wamp\www\test\conn.php on line 4
  </code></pre>
  
  <p>what do i have to define in connection string to make it work?</p>