Manual:$wgDBport

Details
Port number used by the database.

Not used if $wgDBtype is "mysql". Set $wgDBserver to "hostname:port" if you need nonstandard port.

If the database type is Postgres, this defaults to 5432.