Merged the socket patch from Dan Allen
This commit is contained in:
@@ -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 <bigredlinux@yahoo.com>.
|
||||
|
||||
2001-08-19 Olivier M<>ller <om@omnis.ch>
|
||||
* db_readdump.php3: if file contains mutiple queries, only show this line:
|
||||
|
@@ -265,11 +265,17 @@
|
||||
|
||||
<dt><b>$cfgServers[n]['port']</b> string</dt>
|
||||
<dd>
|
||||
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).
|
||||
<br /><br />
|
||||
</dd>
|
||||
|
||||
<dt><b>$cfgServers[n]['socket']</b> string</dt>
|
||||
<dd>
|
||||
The path to the socket to use. Leave blank for default.
|
||||
<br /><br />
|
||||
</dd>
|
||||
|
||||
<dt><b>$cfgServers[n]['adv_auth']</b> boolean</dt>
|
||||
<dd>
|
||||
Whether basic or advanced authentication should be used for this
|
||||
@@ -646,11 +652,10 @@
|
||||
<li>
|
||||
Then, you need to tell PHP to use this socket.<br />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'.<br />
|
||||
open the connection. To do this in phpMyAdmin, you need to complete the
|
||||
socket information in the config.inc.php3.<br />
|
||||
For example:
|
||||
<tt>$cfgServers[n]['host'] = 'localhost:/tmp/mysql.sock';</tt>
|
||||
<tt>$cfgServers[n]['socket'] = '/tmp/mysql.sock';</tt>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@@ -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'] = '';
|
||||
|
17
lib.inc.php3
17
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 '
|
||||
|
Reference in New Issue
Block a user