diff --git a/ChangeLog b/ChangeLog index f4dfaf539..080bd5c74 100755 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,9 @@ $Source$ tbl_properties.php3, lines 45 & 51; tbl_replace, line 143 & 252; tbl_select.php3, line 181: according to rfc 2816, the location http header requires an absolute URI. + * lib.inc.php3, lines 266-277; config.lib.php3, lines 43, 57 & 70; + Documentation.html, lines 273-278 & 655-658: merged the socket patch from + Dan Allen . 2001-08-19 Olivier Müller * db_readdump.php3: if file contains mutiple queries, only show this line: diff --git a/Documentation.html b/Documentation.html index 0bc6dd8d5..237a9ec3d 100755 --- a/Documentation.html +++ b/Documentation.html @@ -265,11 +265,17 @@
$cfgServers[n]['port'] string
- The port-number of your n-th MySQL-server. Default is 3300 (leave + The port-number of your n-th MySQL-server. Default is 3306 (leave blank).

+
$cfgServers[n]['socket'] string
+
+ The path to the socket to use. Leave blank for default. +

+
+
$cfgServers[n]['adv_auth'] boolean
Whether basic or advanced authentication should be used for this @@ -646,11 +652,10 @@
  • Then, you need to tell PHP to use this socket.
    Assuming you are using PHP 3.0.10 or better, you can specify the socket to use when you - open the connection. To do this in phpMyAdmin, you need to edit the - host information in the config.inc.php file using the format - 'host_name:socket_name'.
    + open the connection. To do this in phpMyAdmin, you need to complete the + socket information in the config.inc.php3.
    For example: - $cfgServers[n]['host'] = 'localhost:/tmp/mysql.sock'; + $cfgServers[n]['socket'] = '/tmp/mysql.sock';
  • diff --git a/config.inc.php3 b/config.inc.php3 index 4c4a9ad0b..34980e92c 100755 --- a/config.inc.php3 +++ b/config.inc.php3 @@ -40,6 +40,7 @@ $cfgPmaAbsoluteUri = ''; // You can disable a server config entry by setting host to ''. $cfgServers[1]['host'] = 'localhost'; // MySQL hostname $cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port +$cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket $cfgServers[1]['adv_auth'] = FALSE; // Use advanced authentication? $cfgServers[1]['stduser'] = ''; // MySQL standard user (only needed with advanced auth) $cfgServers[1]['stdpass'] = ''; // MySQL standard password (only needed with advanced auth) @@ -53,6 +54,7 @@ $cfgServers[1]['bookmarktable'] = ''; // Bookmark table - leave blank f $cfgServers[2]['host'] = ''; $cfgServers[2]['port'] = ''; +$cfgServers[2]['socket'] = ''; $cfgServers[2]['adv_auth'] = FALSE; $cfgServers[2]['stduser'] = ''; $cfgServers[2]['stdpass'] = ''; @@ -65,6 +67,7 @@ $cfgServers[2]['bookmarktable'] = ''; $cfgServers[3]['host'] = ''; $cfgServers[3]['port'] = ''; +$cfgServers[3]['socket'] = ''; $cfgServers[3]['adv_auth'] = FALSE; $cfgServers[3]['stduser'] = ''; $cfgServers[3]['stdpass'] = ''; diff --git a/lib.inc.php3 b/lib.inc.php3 index 9920720c1..db9f3da13 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -263,11 +263,18 @@ if (!defined('__LIB_INC__')){ if ($do_auth) { auth(); } else { - if (empty($cfgServer['port'])) { - $dbh = @$connect_func($cfgServer['host'], $cfgServer['stduser'], $cfgServer['stdpass']) or mysql_die(); - } else { - $dbh = @$connect_func($cfgServer['host'] . ':' . $cfgServer['port'], $cfgServer['stduser'], $cfgServer['stdpass']) or mysql_die(); - } + $server_port = (empty($cfgServer['port'])) + ? '' + : ':' . $cfgServer['port']; + $server_socket = (empty($cfgServer['socket']) || PMA_INT_VERSION < 30010) + ? '' + : ':' . $cfgServer['socket']; + $dbh = @$connect_func( + $cfgServer['host'] . $server_port . $server_socket, + $cfgServer['stduser'], + $cfgServer['stdpass'] + ) or mysql_die(); + $PHP_AUTH_USER = str_replace('\'', '\\\'', $PHP_AUTH_USER); $PHP_AUTH_PW = str_replace('\'', '\\\'', $PHP_AUTH_PW); $auth_query = 'SELECT User, Password, Select_priv '