summaryrefslogtreecommitdiffstats
path: root/videomv.pl
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-19 00:29:45 +0100
committerGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-19 00:29:45 +0100
commit2c13efc16088fab44cadf6c819b286d51100e527 (patch)
treea50fb7c62fc39ef46bae7f4cc3dd927985501eaf /videomv.pl
parent720cef33dd67d0767c650ea8b55d61ea70428657 (diff)
the port is useless when connecting through a UNIX socket
Diffstat (limited to 'videomv.pl')
-rwxr-xr-xvideomv.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/videomv.pl b/videomv.pl
index 2448855..e4c2a14 100755
--- a/videomv.pl
+++ b/videomv.pl
@@ -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
@@ -307,7 +307,7 @@ e.g.,
videodir => catdir($HOME,'video'),
driver => 'mysql',
database => 'videodb',
- hostname => '127.0.0.1',
+ hostname => 'example.org',
user => 'username',
port => 3306,
password => '******',
@@ -379,7 +379,8 @@ my @real_directors = splitdir($real_directors);
# Connect to database
my ($dsn, $dbh, $RES, $nRES, $id);
unless (defined $ignoredb_flag) {
- $dsn = "DBI:$config{driver}:database=$config{database};host=$config{hostname};port=$config{port}";
+ $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";