diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-02-19 00:29:45 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-02-19 00:29:45 +0100 |
commit | 2c13efc16088fab44cadf6c819b286d51100e527 (patch) | |
tree | a50fb7c62fc39ef46bae7f4cc3dd927985501eaf /videorm.pl | |
parent | 720cef33dd67d0767c650ea8b55d61ea70428657 (diff) |
the port is useless when connecting through a UNIX socket
Diffstat (limited to 'videorm.pl')
-rwxr-xr-x | videorm.pl | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -29,7 +29,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 @@ -109,7 +109,7 @@ e.g., videodir => catdir($HOME,'video'), driver => 'mysql', database => 'videodb', - hostname => '127.0.0.1', + hostname => 'example.org', user => 'username', port => 3306, password => '******', @@ -161,7 +161,8 @@ if (-l $file_s) { # 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"; |