Added server to database connect calls.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@274 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2003-01-10 22:20:23 +00:00
parent c70be5a6bf
commit 94fd698ec6
3 changed files with 6 additions and 3 deletions

View File

@ -36,6 +36,7 @@
#
# ==========================================================================
use constant DB_NAME => "zm";
use constant DB_NAME => "zm";
use constant DB_USER => "zmadmin";
use constant DB_PASS => "zmadminzm";
use constant IMAGE_PATH => "@WEB_PREFIX@/images";
@ -127,7 +128,8 @@ if ( $report && $yes )
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 );
if ( !$yes && !$report )
{

View File

@ -75,7 +75,8 @@ select( STDERR ); $| = 1;
select( LOG ); $| = 1;
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 $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );

View File

@ -168,7 +168,7 @@ sub runServer
bind( SERVER, $saddr ) or die( "Can't bind: $!" );
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 );