parapara has asked for the wisdom of the Perl Monks concerning the following question:

Hi
I need to use a mysql socket, but I can't find wether it is possible or not with DBI.
Does anybody know if I can tell DBI to use a particular socket for example inside a connection?
Where can I find some documentation?
If it is not possible with DBI is there another way?
I tried this
$ENV{MYSQL_UNIX_PORT} = "/tmp/mysql.sock";
but I continue to receive
Can't connect to local MySQL server through socket /tmp/mysql.sock
but my socket exists, it has all the permissions and is specified also inside my.cnf
Thanks :)

Replies are listed 'Best First'.
Re: How to use a specific socket with DBI
by duff (Parson) on Feb 21, 2006 at 15:19 UTC

    From perldoc DBI:

    Examples of $data_source values are:
    
        dbi:DriverName:database_name
        dbi:DriverName:database_name@hostname:port
        dbi:DriverName:database=database_name;host=hostname;port=port
    

    I think this answers your question. (unless by "socket" you mean an already existing connection, in which case, I have no idea)

Re: How to use a specific socket with DBI
by marto (Cardinal) on Feb 21, 2006 at 15:22 UTC