connect to mysql using a different socket


/ Published in: Perl
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.