From 1e5813d4f49274ea64e2fc9165aaffad16b468bc Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 23 Oct 2002 20:09:29 +0000
Subject: [PATCH] - Made it possible to connect to mysql databases running on
 non-standard   ports.  Patch by Alastair.

---
 includes/database.mysql.inc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index a7151cefd56b..5e578fbc2254 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -4,6 +4,11 @@
 function db_connect($url) {
   $url = parse_url($url);
 
+  // Allow for non-standard MySQL port.
+  if ($url["port"]) {
+     $url["host"] = $url["host"] . ":" . $url["port"];
+  }
+  
   mysql_pconnect($url["host"], $url["user"], $url["pass"]) or die(mysql_error());
   mysql_select_db(substr($url["path"], 1)) or die("unable to select database");
 
-- 
GitLab