Prev | Current Page 41 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"

For all servers to which we
connect using the mysql extension, this parameter, when set to TRUE, instructs PHP
to keep the connection to the MySQL server open. This speeds up the interaction
between PHP and MySQL. However, it is set to FALSE by default in config.inc.
php, because persistent connections are often a cause of resource depletion on
servers??”MySQL refusing new connections. For this reason, the option is not even
available for the mysqli extension, so setting it to TRUE here would have no effect if
you are connecting with this extension.
connect_type, socket and port
Both the mysql and mysqli extensions automatically use a socket to connect to
MySQL if the server is on localhost. Consider this configuration:
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
Installing phpMyAdmin
[ 30 ]
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
The default value for connect_type is tcp. However, the extension will use a socket
because it concludes that this is more efficient as the host is localhost, so in this
case, we can use tcp or socket as the connect_type. To force a real tcp connection,
we can specify 127.0.0.1 instead of localhost in the host parameter. Because the
socket parameter is empty, the extension will try the default socket.


Pages:
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53