The new mysqli adapter in 1.22.0 does not properly implement non-standard MySQL ports.
While mysql_connect accepts an optional port number in the host parameter, mysqli's real_connect does not. Instead, using an explicit parameter is expected:
bool mysqli::real_connect ([ string $host [, string $username [, string $passwd
[, string $dbname [, int $port [, string $socket [, int $flags ]]]]]]] )
^^^^^^^^^^
The current implementation just sets 'null' and provides the 'ip:port' string as $host parameter, resulting in failures such as "DB connection error: Unknown MySQL server host '127.0.0.1:4306'".
I could provide a patch if needed, I'm not sure though if this should use $wgDBport (which would fix bug 36300 at the same time), or if the performance hit from exploding the port every time is acceptable.
Version: 1.22.0
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=65998