Bug 3443 - DBIx uses wrong socket to connect to MySQL
: DBIx uses wrong socket to connect to MySQL
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: unspecified
: PC RedHat Linux
: P2 major (vote)
: ---
Assigned To: Chris Owens
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-24 03:17 UTC by Robin Bowes
Modified: 2008-09-15 14:39 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
Possible Fix (2.23 KB, patch)
2006-05-24 07:57 UTC, Dan Sully
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Bowes 2006-05-24 03:17:09 UTC
Just updated to latest trunk incorporating split-scanner stuff.
I see this error:
2006-05-24 11:11:39.252726500 DBIx::Class::Storage::DBI::dbh(): DBI Connection failed: DBI connect('database=slimserver-trunk','slimserver',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/local/slimserver/trunk/server/CPAN/DBIx/Class/Storage/DBI.pm line 407

On my installation (Fedora Core 4) the local mysql socket is specified in /etc/my.cnf and is:

socket=/var/lib/mysql/mysql.sock

DBIx is ignoring this.

I've discussed this problem with Dan when running the split-scanner branch.
Comment 1 Robin Bowes 2006-05-24 04:33:35 UTC
I should clarify... this is when I try to use my existing MySQL installation.
Comment 2 Robin Bowes 2006-05-24 04:44:46 UTC
    From the DBD::mysql docs:

    mysql_socket

        As of MySQL 3.21.15, it is possible to choose the Unix socket that is used for connecting to the server. This is done, for example, with

            mysql_socket=/dev/mysql

        Usually there's no need for this option, unless you are using another location for the socket than that built into the client.

    So, a work around for this issue is to modify the mysql DSN in slimserver.conf:

    dbsource: dbi:mysql:database=slimserver-trunk:mysql_socket=/var/lib/mysql/mysql.sock

    "mysql_config --socket" return the location of the socket for an existing mysql installation. Perhaps the mysql helper code should run this and add the socket to the dbsource line in slimserver.conf?

Comment 3 Dan Sully 2006-05-24 07:57:57 UTC
Created attachment 1249 [details]
Possible Fix

I've attached a possible fix - can you apply and let me know?

Thanks
Comment 4 Robin Bowes 2006-05-24 08:06:51 UTC
s/\$dsn/\$source/

It works.
Comment 5 Dan Sully 2006-05-24 08:10:05 UTC
Fixed in change 7635