Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 23915
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: "host=localhost" seems to ignore TCP and goes direct to UNIX socket
The DSN of DBI->connect( "DBI:mysql:host=127.0.0.1;port=12345" ) works as you'd expect; namely, connecting to the given TCP port. But the equal-looking DBI->connect( "DBI:mysql:host=localhost;port=12345" ) seems to ignore TCP entirely, and attempt to connect directly using the UNIX socket. I tried stracing them: $ strace perl -e 'use DBI; DBI->connect( "DBI:mysql:host=127.0.0.1;port=12345" );' ... connect(3, {sa_family=AF_INET, sin_port=htons(12345), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused) $ strace perl -e 'use DBI; DBI->connect( "DBI:mysql:host=localhost;port=12345" );' ... connect(3, {sa_family=AF_FILE, path="/var/run/mysqld/mysqld.sock"}, 110) = 0 For reference: Linux debian/testing running on i686 $ perl --version This is perl, v5.8.8 built for i486-linux-gnu-thread-multi $ perl -MDBD::mysql -e 'print $DBD::mysql::VERSION' 3.0008 $ apt-cache depends libdbd-mysql-perl ... Depends: libmysqlclient15off $ dpkg -l libmysqlclient15off ii libmysqlclient15off 5.0.30-1 mysql database client library -- Paul Evans
This is by design, and consistent with the mysql_connect() method of the underlying C API and behavior of other MySQL tools and libraries.
Subject: Re: [rt.cpan.org #23915] "host=localhost" seems to ignore TCP and goes direct to UNIX socket
Date: Thu, 14 Dec 2006 02:05:31 +0100
To: bug-DBD-mysql [...] rt.cpan.org
From: Frederik Ramm <frederik [...] remote.org>
I am really sorry to bother you all with this but I have, unsuccessfully, tried to find any kind of unregister or unsubscribe option anywhere on CPAN, and also e-mailed anyone looking remotely responsible for this list. I did not ask to be put on this list, and have nothing to do with DBD-mysql (I did submit a few changes, about 8 years ago or so, and that was it). My CPAN email address is framm@cpan.org. If anyone can stop these "rt.cpan.org" mails being sent to my account, please do so. Regards Frederik Jim Winstead via RT wrote: Show quoted text
> Queue: DBD-mysql > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=23915 > > > This is by design, and consistent with the mysql_connect() method of the underlying C API and > behavior of other MySQL tools and libraries.
-- Frederik Ramm ## eMail frederik@remote.org ## N49°00.09' E008°23.33'
On Wed Dec 13 19:21:56 2006, JIMW wrote: Show quoted text
> This is by design, and consistent with the mysql_connect() method of > the underlying C API and > behavior of other MySQL tools and libraries.
Ah OK. Consistency is good. In that case, perhaps the documentation could be ammeded, putting in a note about this? It caused much confusion since I was not aware of this behaviour. -- Paul Evans
I've added some clarification to the documentation.