title: mysql_connect to Remote Server from local machine
body: <p>So I'm trying develop on my local machine, while using one database on my remote server.</p>
  
  <p>To do this I've tried changing the myql_connect line.</p>
  
  <p>from </p>
  
  <pre><code>$con = mysql_connect("localhost", "username", "pw");
  </code></pre>
  
  <p>to</p>
  
  <pre><code>$con = mysql_connect("mydomain.com:2082", "username", "pw");
  </code></pre>
  
  <p>and now I'm getting the following errors</p>
  
  <blockquote>
    <p>Warning: mysql_connect() [function.mysql-connect]: MySQL server has<br>
    gone away in C:\xampp\htdocs\posts\index.php on line 27 Warning:<br>
    mysql_connect() [function.mysql-connect]: Error while reading greeting<br>
    packet. PID=5092 in C:\xampp\htdocs\posts\index.php on line 27<br>
    Warning: mysql_connect() [function.mysql-connect]: MySQL server has<br>
    gone away in C:\xampp\htdocs\posts\index.php on line 27 Fatal error:<br>
    Maximum execution time of 30 seconds exceeded in<br>
    C:\xampp\htdocs\posts\index.php on line 27  </p>
  </blockquote>
  
  <p>I don't really understand what the :2082 is or what it does. In the examples on the php page it uses :3307, but when I log into cpanel on my remote server it always has :2082 after my domain name. In any case 3307 doesn't work either.</p>
  
  <p>Can anyone help me figure out what I'm doing wrong? (or should I be doing something different -- like changing the mysql default host somewhere in the php.ini[??] and then continue to use <code>local</code> host in the <code>mysql_connect</code>?</p>
  
  <p>Thanks for your help.</p>