----- Original Message -----
From: "Jakob Dölling"

> Hi:
> > This surprised me! I have been connecting with named pipes (and
> > others to do the same) on Win2k since I discovered them, because my
> > (and time to connect) are most definitely *faster*. The
> > communication is about 25-30% slower using TCP/IP. Example: a simple
> > COUNT(*) FROM table takes 0.3ms with TCP/IP compared to only 0.16ms
> > named pipes. Or, on a more complicated query, 2ms vs 1.5.
> Just being curios: How is possible to change the connection type? Do I
> to compile MySQL?

First, you need to enable named pipes with enable-named-pipe in the
[mysqld] section of my.ini. Then, just don't use 'localhost' (which uses
TCP/IP on Windows) as the hostname in mysql_connect(). :-) Using '.'
(just a period) specifies named pipes. But by using a blank/empty string
for hostname, named pipes will be used if available, else TCP/IP.

Note that 'localhost' on *nix is special and doesn't use TCP/IP, but the
faster Unix sockets. But again, by just leaving the hostname blank, this
will be used anyway.

So I just leave the hostname blank when MySQL is on the local system to
get the best connection available. It seems that an address is only
needed to connect to a separate MySQL box.

See also the first 2 paragraphs here in the manual:

Hope that helps.


MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to