Posted By

alfirth on 05/04/11


Tagged

mysql socket DBI dbh dbn


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

shalomfriss


connect to mysql using a different socket


 / Published in: Perl
 

  1. my $dsn = "dbi:mysql:$db_name:$db_server:$db_port;mysql_socket=/san01/mysql/data1/mysql.sock";
  2. my $dbh = DBI->connect($dsn, $db_user, $db_pass) or die "Unable to connect: $DBI::errstr\n";
  3. my $qry = $dbh->prepare($query);
  4. $qry->execute();

Report this snippet  

You need to login to post a comment.