Can't connect to a remote MySQL during installation, drupal uses unix_socket instead of host?
I think I have located this issue. includes/database/mysql/database.inc, line 32:

// The DSN should use either a socket or a host/port.
if (isset($connection_options['unix_socket'])) {// will be TRUE if unix_socket is ''
  $dsn = 'mysql:unix_socket=' . $connection_options['unix_socket'];
}
else {
  // Default to TCP connection on port 3306.
  $dsn = 'mysql:host=' . $connection_options['host'] . ';port=' . (empty($connection_options['port']) ? 3306 : $connection_options['port']);
}


$connection_options['unix_socket'] will be an empty string if we leave it empty on the page. So this test will be TRUE. Replace isset with !empty solve this issue:)