title: PDO cannot connect remote mysql server
body: <p>server A(192.168.1.3)</p>
  
  <p>mysql server(5.6.12) port 6603,socket /var/run/mysql/mysql.sock</p>
  
  <p>php(5.5.0) php.ini pdo_mysql.default_socket = /var/run/mysql/mysql.sock</p>
  
  <p>server B(192.168.1.4)</p>
  
  <p>mysql server(5.5.11) port 3306,socket /var/run/mysql/mysql.sock</p>
  
  <p>In server A is work when use</p>
  
  <pre><code>$conn = new PDO('mysql:hostname=localhost;dbname=DB_TEST','username','password');
  </code></pre>
  
  <p>but cannot connect to server B when use</p>
  
  <pre><code>$conn = new PDO('mysql:hostname=192.168.1.4;dbname=DB_TEST;port=3306','username','password');
  </code></pre>
  
  <blockquote>
    <p>ERROR:SQLSTATE[28000] [1045] Access denied for user 'username'@'localhost'
    (using password: YES)</p>
  </blockquote>
  
  <p>but work on</p>
  
  <pre><code>$conn = mysql_connect('192.168.1.4:3306', 'username', 'password');
  </code></pre>