Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15093 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15519 invoked by uid 1010); 18 Feb 2005 15:11:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15486 invoked from network); 18 Feb 2005 15:11:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2005 15:11:49 -0000 X-Host-Fingerprint: 64.233.184.207 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.207:32110] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 1.2 (r4437)) with SMTP id 87/05-02682-4B506124 for ; Fri, 18 Feb 2005 10:11:48 -0500 Received: by wproxy.gmail.com with SMTP id 63so200290wri for ; Fri, 18 Feb 2005 07:11:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=F7vS4000rZ7Sg7RYl/6jC3LxQc6Ht5e8u9VRBbgK6Iy0KppeJumNdnsk3JQnTEH05r2vL22M+yq4pBFLzvWHHYjMdynLuyj88lKV/wk5T8+2fr+6Izw+XBexN7jXdwuOsopLvAc+goTnfs5OoK0fF2YLGbSnLevZMiAGFiAle0o= Received: by 10.54.17.6 with SMTP id 6mr95436wrq; Fri, 18 Feb 2005 07:11:46 -0800 (PST) Received: by 10.54.59.22 with HTTP; Fri, 18 Feb 2005 07:11:45 -0800 (PST) Message-ID: <4e89b426050218071114cceab0@mail.gmail.com> Date: Fri, 18 Feb 2005 10:11:45 -0500 Reply-To: Wez Furlong To: Timm Friebe Cc: internals@lists.php.net In-Reply-To: <1108721794.312.6.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1108721794.312.6.camel@localhost> Subject: Re: [PHP-DEV] PDO/MySQL connect broken for remote hosts From: kingwez@gmail.com (Wez Furlong) Thanks; committed. --Wez. On Fri, 18 Feb 2005 11:16:34 +0100, Timm Friebe wrote: > Hi, > has anyone noticed PDO/MySQL will always try to connect locally > regardless of what I put in the host=... DSN part? > > The statement: > new PDO('mysql:host=php3.de', '****', '*******'); > > will only throw a PDOException: > > Fatal error: Uncaught exception 'PDOException' with message > 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through > socket '/tmp/mysql.sock' (2)' in /usr/home/thekid/pdo.php:2 > > This here fixes it: > > Index: ext/pdo_mysql/mysql_driver.c > =================================================================== > RCS file: /repository/php-src/ext/pdo_mysql/mysql_driver.c,v > retrieving revision 1.36 > diff -u -r1.36 mysql_driver.c > --- ext/pdo_mysql/mysql_driver.c 13 Feb 2005 17:16:24 -0000 > 1.36 > +++ ext/pdo_mysql/mysql_driver.c 18 Feb 2005 10:00:31 -0000 > @@ -327,6 +327,7 @@ > if (vars[2].optval && !strcmp("localhost", vars[2].optval)) { > unix_socket = vars[4].optval; > } else { > + host = vars[2].optval; > port = atoi(vars[3].optval); > } > dbname = vars[1].optval; > > -- > Timm > If it ain't broken, it doesn't have enough features yet > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >