--- ext/mysqlnd/mysqlnd.c 2010-03-09 09:39:20.000000000 +0100 +++ ext/mysqlnd/mysqlnd.c 2010-03-09 09:00:40.000000000 +0100 @@ -527,9 +527,6 @@ db = ""; db_len = 0; } - if (!port && !socket) { - port = 3306; - } host_len = strlen(host); #ifndef PHP_WIN32 if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) { @@ -541,6 +538,10 @@ } else #endif { + if (!port) { + port = 3306; + } + transport_len = spprintf(&transport, 0, "tcp://%s:%d", host, port); } DBG_INF_FMT("transport=%s", transport);