Connecting to a distant host doesnt work
<p>I try to connect to a distant host like this:</p>

<pre><code>    class Singleton {
  public static $connection;

  public static function getConnection(){
      if(self::$connection==null){
         $dsn = 'mysql:dbname=gtrscrpt_ubot;';
         $user = 'MyUser';
         $password = 'MyPassword';
        try {
           self::$connection = new PDO('mysql:host=gator188.hostgator.com;port=2983;dbname=gtrscpt_ubot;',$user,$password );
           self::$connection-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $e) {
            echo 'Connection failed: ' . $e-&gt;getMessage();
        }
      }
      return self::$connection;
  }

}


Singleton::getConnection();
</code></pre>

<p>I get this:</p>

<pre><code>Connection failed: SQLSTATE[HY000] [2006] MySQL server has gone away
</code></pre>

<p>The problem is that I dont know if my code is wrong or cant I really connect to the server (I know however that I should connect)</p>

<p><strong>UPDATE:</strong>
Connection failed: SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file**</p>
