Added server to database connect calls.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@274 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
c70be5a6bf
commit
94fd698ec6
|
@ -36,6 +36,7 @@
|
||||||
#
|
#
|
||||||
# ==========================================================================
|
# ==========================================================================
|
||||||
use constant DB_NAME => "zm";
|
use constant DB_NAME => "zm";
|
||||||
|
use constant DB_NAME => "zm";
|
||||||
use constant DB_USER => "zmadmin";
|
use constant DB_USER => "zmadmin";
|
||||||
use constant DB_PASS => "zmadminzm";
|
use constant DB_PASS => "zmadminzm";
|
||||||
use constant IMAGE_PATH => "@WEB_PREFIX@/images";
|
use constant IMAGE_PATH => "@WEB_PREFIX@/images";
|
||||||
|
@ -127,7 +128,8 @@ if ( $report && $yes )
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
my $dbh = DBI->connect( "DBI:mysql:".DB_NAME, DB_USER, DB_PASS );
|
my $dbh = DBI->connect( "DBI:mysql@".DB_SERVER.":".DB_NAME, DB_USER, DB_PASS );
|
||||||
|
|
||||||
chdir( EVENT_PATH );
|
chdir( EVENT_PATH );
|
||||||
if ( !$yes && !$report )
|
if ( !$yes && !$report )
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,7 +75,8 @@ select( STDERR ); $| = 1;
|
||||||
select( LOG ); $| = 1;
|
select( LOG ); $| = 1;
|
||||||
print( "Watchdog starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" );
|
print( "Watchdog starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" );
|
||||||
|
|
||||||
my $dbh = DBI->connect( "DBI:mysql:".DB_NAME, DB_USER, DB_PASS );
|
my $dbh = DBI->connect( "DBI:mysql@".DB_SERVER.":".DB_NAME, DB_USER, DB_PASS );
|
||||||
|
|
||||||
my $sql = "select * from Monitors";
|
my $sql = "select * from Monitors";
|
||||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ sub runServer
|
||||||
bind( SERVER, $saddr ) or die( "Can't bind: $!" );
|
bind( SERVER, $saddr ) or die( "Can't bind: $!" );
|
||||||
listen( SERVER, SOMAXCONN ) or die( "Can't listen: $!" );
|
listen( SERVER, SOMAXCONN ) or die( "Can't listen: $!" );
|
||||||
|
|
||||||
$dbh = DBI->connect( "DBI:mysql:".main::DB_NAME, main::DB_USER, main::DB_PASS );
|
$dbh = DBI->connect( "DBI:mysql@".DB_SERVER.":".DB_NAME, DB_USER, DB_PASS );
|
||||||
|
|
||||||
$x10 = new X10::ActiveHome( port=>main::X10_DEVICE, house_code=>main::X10_HOUSE_CODE, debug=>1 );
|
$x10 = new X10::ActiveHome( port=>main::X10_DEVICE, house_code=>main::X10_HOUSE_CODE, debug=>1 );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue