From 42f96dc7a6dca1e507570a8e78ba32b54468fc09 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Wed, 10 Apr 2019 14:13:16 +0200 Subject: [PATCH 1/2] Fix use UNIX socket file to connect DB --- include/dba/dba_pdo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php index 5002f53e7..a70e4a1d7 100755 --- a/include/dba/dba_pdo.php +++ b/include/dba/dba_pdo.php @@ -19,7 +19,7 @@ class dba_pdo extends dba_driver { $this->driver_dbtype = $scheme; if(strpbrk($server,':;')) { - $dsn = $server; + $dsn = $this->driver_dbtype . ':unix_socket=' . trim($server, ':;'); } else { $dsn = $this->driver_dbtype . ':host=' . $server . (intval($port) ? ';port=' . $port : ''); From 775285cdf8faebb77e1725e7c88de82129acd3c4 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Wed, 10 Apr 2019 14:14:14 +0200 Subject: [PATCH 2/2] Update comment htconfig.sample.php --- install/htconfig.sample.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/htconfig.sample.php b/install/htconfig.sample.php index 07725e3f4..509942530 100755 --- a/install/htconfig.sample.php +++ b/install/htconfig.sample.php @@ -12,7 +12,7 @@ // Then set the following for your MySQL installation -$db_host = 'your.mysqlhost.com'; // Use 'localhost' if you aren't using a remote server +$db_host = 'your.mysqlhost.com'; // Use 'localhost' or ':/path/to/socket.file' if you aren't using a remote server $db_port = 0; // leave 0 for default or set your port $db_user = 'mysqlusername'; $db_pass = 'mysqlpassword';