[Fwd: PDO __construct question (mysql)]

From: Date: Sat, 13 Nov 2004 09:37:12 +0000
Subject: [Fwd: PDO __construct question (mysql)]
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-1616@lists.php.net to get a copy of this message
Seen as on php.general nobody seemed to know an answer, I figured I'd try my luck over here aswell. anyone? - Tul -------- Original Message -------- Subject: PDO __construct question (mysql) Date: Fri, 12 Nov 2004 22:11:43 +0100 From: M. Sokolewicz <tularis@php.net> Newsgroups: php.general hi, currently I'm experimenting with PDO a bit. I run a local mysql server, version 4.1.4, so I tried connecting to that. Here is my code at this point:
        try {
            $link = new PDO('mysql:dbname=mydb;host=localhost', 'me',
'pw', array(PDO_ATTR_AUTOCOMMIT => 0, PDO_ATTR_PERSISTENT=>0));
        } catch(PDOException $e) {
            echo 'Connection Error:
'.$e->getMessage()."\n".$e->getTraceAsString();
            exit;
        }
Now, it doesn't matter if the server is turned on or off, I am recieving: Connection Error: [2017] Can't open named pipe to host: . pipe: MySQL (2) At first, I thought that this was due to me writing the DSN incorrectly. But after reading trough various documents, including Wez's Powerpoint Presentation at PHPWorks, I think the DSN I'm using IS correctly written (or at least syntactically correct). After that, I figured it might be because PDO_mysql officially doesn't support mysql 4.1+, but when the server is turned OFF (the mysql server), it still reports EXACTLY the same error. Does anyone have an idea what is wrong EXACTLY here? To me the message seems pretty strange, and I don't understand what it means. Thanks, - Tul

« previous php.pecl.dev (#1616) next »