title: PDO can connect to MySQL in localhost, but not remote, even they are the same server
body: <p>Let's say the MySQL server is <code>mydomain.com:3306</code>, and the Apache and MySQL are on the same server machine.</p>
  
  <p>When I upload my PHP script to the server, I can always connect the MySQL with PDO and this DNS:</p>
  
  <pre><code>mysql:host=localhost;dbname=my_database
  </code></pre>
  
  <p>However, if I change the DNS string to this: </p>
  
  <pre><code>mysql:host=mydomain.com;dbname=my_database 
  </code></pre>
  
  <p>Just changed <code>localhost</code> to <code>mydomain.com</code>, all others settings like username and password remain the same. I got this warning:</p>
  
  <pre><code>OK packet 6 bytes shorter than expected
  </code></pre>
  
  <p>I found many discussions about the <code>OK packet 6 bytes shorter than expected</code> problem and they are all related to the password hashing. However, since I can connect to the server using the <code>localhost</code> setting, I don't think in my case the password hashing is the reason.</p>
  
  <p>Any one got this problem?</p>
  
  <p>p.s. I'm using Kohana 3.0.9's database module to do the connection.<br>
  p.p.s. MySQL version: 5.1.52, PHP version: 5.3.2</p>