From 2c13efc16088fab44cadf6c819b286d51100e527 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 19 Feb 2012 00:29:45 +0100 Subject: the port is useless when connecting through a UNIX socket --- videodb-check.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'videodb-check.pl') diff --git a/videodb-check.pl b/videodb-check.pl index 1e5691b..bf45d6b 100755 --- a/videodb-check.pl +++ b/videodb-check.pl @@ -24,7 +24,7 @@ my %config = do $confile; die "Error in `" .$confile. "'\n" if $@ || not %config; map { exists $config{$_} || die "Error: Missing `${_}'.\n" } - qw /videodir driver database hostname user port password/; + qw /videodir driver database hostname user password/; $config{prefix} = "" unless exists $config{prefix}; my $symlinks = catdir($config{videodir},'MOVIES'); # Symlinks folder @@ -102,7 +102,7 @@ e.g., videodir => catdir($HOME,'video'), driver => 'mysql', database => 'videodb', - hostname => '127.0.0.1', + hostname => 'example.org', user => 'username', port => 3306, password => '******', @@ -134,7 +134,8 @@ if (@ARGV) { ################################################################################ # Connect to database -my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname};port=$config{port}"; +my $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname}"; +$dsn .= ";port=$config{port}" if defined $config{port}; if (defined $config{dbi_misc}) { while (my ($k,$v) = each %{$config{dbi_misc}}) { $dsn .= ";$k=$v"; -- cgit v1.2.3