Bugzilla – Bug 3443
DBIx uses wrong socket to connect to MySQL
Last modified: 2008-09-15 14:39:24 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.
I should clarify... this is when I try to use my existing MySQL installation.
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?
Created attachment 1249 [details] Possible Fix I've attached a possible fix - can you apply and let me know? Thanks
s/\$dsn/\$source/ It works.
Fixed in change 7635