Re: mysql->connect unix socket and host:port feature
| From: | Paul DuBois | Date: | Sat, 09 Feb 2002 22:29:06 +0000 |
| Subject: | Re: mysql->connect unix socket and host:port feature | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4520@lists.php.net to get a copy of this message | ||
At 20:45 +0100 2/9/02, Pierre-Alain Joye wrote:
On Sat, 09 Feb 2002 20:12:48 +0100 "Tomas V.V.Cox" <cox@idecnet.com> wrote:Why is this a problem? You can only use a socket for localhost. If you specify a host name (even the FQDN of the local host) you have to use a TCP/IP connection. If the parameters are specified as you indicate below, the intent is ambiguous. The connection code has to resolve it one way or the other, and it just happens to resolve it in the way that makes most sense according to the MySQL documentation.Pierre-Alain Joye wrote: You are late this time, this is implemented and documented :-):) better late than never ;), but... If you take a look in the mysql connect function, if you use unix socket connection, the function does not take care about the host. And the problem is the admin of my customer use a mix of host/port and unix socket.
if ($dsninfo['protocol'] == 'unix') {
$dbhost = ':' . $dsninfo['socket'];
} else {
$dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost';
if ($dsninfo['port']) {
$dbhost .= ':' . $dsninfo['port'];
}
}
If protocol is unix, cya for the host.
Exactly. And that's correct.
The mysql must be accessed with these parameters : unix socket :/var/mysqlmyweb.sock host : localhost port : 13306 user : mywebuser pass : thepass I try to told him it s completly stupid to run multiple main instances of mysql on a simple sparc server (the basic one) and in the same way for iplanet, 5 sec for a single query with 2 where clauses on a 2000 records table... I certainly miss something during the stress of installation (I hate iplanet for ever ;) ) or I m a complet dummy and need to sleep for a while ;). btw anyone has good experience with iplanet/php will be welcome :). pa