diff --git a/system/Database/SQLSRV/Connection.php b/system/Database/SQLSRV/Connection.php index acbada4e6c0a..f180ca4f6b3b 100755 --- a/system/Database/SQLSRV/Connection.php +++ b/system/Database/SQLSRV/Connection.php @@ -120,6 +120,10 @@ public function connect(bool $persistent = false) unset($connection['UID'], $connection['PWD']); } + if (strpos($this->hostname, ',') === false && $this->port !== '') { + $this->hostname .= ', ' . $this->port; + } + sqlsrv_configure('WarningsReturnAsErrors', 0); $this->connID = sqlsrv_connect($this->hostname, $connection); diff --git a/user_guide_src/source/changelogs/v4.2.0.rst b/user_guide_src/source/changelogs/v4.2.0.rst index 8a280839758b..55a5e6b9739d 100644 --- a/user_guide_src/source/changelogs/v4.2.0.rst +++ b/user_guide_src/source/changelogs/v4.2.0.rst @@ -119,5 +119,6 @@ Deprecations Bugs Fixed ********** +- The SQLSRV driver ignores the port value from the config. See the repo's `CHANGELOG.md `_ for a complete list of bugs fixed.