in reply to Connect to MySQL server on Windows using named pipe (perl DBD::mysql)

Try escaping the ":" c\:\/temp\/mysql.sock
  • Comment on Re: Connect to MySQL server on Windows using named pipe (perl DBD::mysql)
  • Download Code

Replies are listed 'Best First'.
Re^2: Connect to MySQL server on Windows using named pipe (perl DBD::mysql)
by darist (Initiate) on Oct 27, 2010 at 03:57 UTC

    Hi again!

    Thanks for the reply! Escaping the ":" didn't work... but I think I figured it out...

    I don't really understand it, but it looks like in Windows it doesn't really want a full path, just a name, so I took out the "socket=c:/temp..." from the my.ini file (so it would use the default name for the named pipe, which is "MySQL" from what I've read).

    Then for the connection, I did this:

    my $dsn = "DBI:mysql:database=mydb;host=.";

    ... and it just worked! The mysql program (client that comes with the installation of MySQL) also uses the hostname "." as the way to specify the use of named pipes.

    This syntax worked too:

    my $dsn = "DBI:mysql:mydb:.";
    Thanks, David