Updated zmconfig defines and now uses DB server.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@267 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
1e0ba22367
commit
46e9fa04de
|
@ -113,12 +113,12 @@ int main( int argc, char *argv[] )
|
||||||
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( !mysql_connect( &dbconn, "", ZM_DB_USERA, ZM_DB_PASSA ) )
|
if ( !mysql_connect( &dbconn, ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( mysql_select_db( &dbconn, ZM_DATABASE ) )
|
if ( mysql_select_db( &dbconn, ZM_DB_NAME ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
|
|
|
@ -101,12 +101,12 @@ int main( int argc, char *argv[] )
|
||||||
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( !mysql_connect( &dbconn, "", ZM_DB_USERA, ZM_DB_PASSA ) )
|
if ( !mysql_connect( &dbconn, ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( mysql_select_db( &dbconn, ZM_DATABASE ) )
|
if ( mysql_select_db( &dbconn, ZM_DB_NAME ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
|
|
|
@ -19,16 +19,17 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define ZM_DB_NAME "<from zmconfig>" // Database name
|
#define ZM_DB_SERVER "localhost" // Machine on which the database server is running (from zmconfig)
|
||||||
#define ZM_DB_USERA "<from zmconfig>" // Privileged DB user name, needs at least select, insert, delete privileges
|
#define ZM_DB_NAME "zm" // Database containing the tables (from zmconfig)
|
||||||
#define ZM_DB_PASSA "<from zmconfig>" // Privileged DB user password
|
#define ZM_DB_USERA "" // Privileged DB user name, needs at least select, insert, update and delete privileges (from zmconfig)
|
||||||
#define ZM_DB_USERB "<from zmconfig>" // Unprivileged DB user name, need just select privilege.
|
#define ZM_DB_PASSA "" // Privileged DB user password (from zmconfig)
|
||||||
#define ZM_DB_PASSB "<from zmconfig>" // Unprivileged DB user password
|
#define ZM_DB_USERB "" // Unprivileged DB user name, need just select privilege. (from zmconfig)
|
||||||
|
#define ZM_DB_PASSB "" // Unprivileged DB user password (from zmconfig)
|
||||||
|
|
||||||
#define ZM_SHM_KEY <from zmconfig> // Base shared memory key
|
#define ZM_SHM_KEY 0x7a6d2000 // Shared memory key to use, only change if it clashes with another application (from zmconfig)
|
||||||
|
|
||||||
#define ZM_EVENT_DIR <from zmconfig> // Event directory relative to web directory
|
#define ZM_EVENT_DIR "events" // Local path to where events directory lives (from zmconfig)
|
||||||
|
|
||||||
#define ZM_FORCED_ALARM_SCORE <from zmconfig> // Score to give X10 forced alarms
|
#define ZM_FORCED_ALARM_SCORE 255 // Score to give X10 forced alarms (from zmconfig)
|
||||||
|
|
||||||
#define ZM_RECORD_EVENT_STATS <from zmconfig> // Whether to record event statistical information, change to false if too slow
|
#define ZM_RECORD_EVENT_STATS true // Whether to record event statistical information, change to no if too slow (from zmconfig)
|
||||||
|
|
|
@ -48,12 +48,12 @@ int main( int argc, char *argv[] )
|
||||||
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( !mysql_connect( &dbconn, "", ZM_DB_USERA, ZM_DB_PASSA ) )
|
if ( !mysql_connect( &dbconn, ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( mysql_select_db( &dbconn, ZM_DATABASE ) )
|
if ( mysql_select_db( &dbconn, ZM_DB_NAME ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
|
|
|
@ -67,12 +67,12 @@ int main( int argc, const char *argv[] )
|
||||||
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( !mysql_connect( &dbconn, "", ZM_DB_USERB, ZM_DB_PASSB ) )
|
if ( !mysql_connect( &dbconn, ZM_DB_SERVER, ZM_DB_USERB, ZM_DB_PASSB ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( mysql_select_db( &dbconn, ZM_DATABASE ) )
|
if ( mysql_select_db( &dbconn, ZM_DB_NAME ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
|
|
|
@ -151,12 +151,12 @@ int main( int argc, char *argv[] )
|
||||||
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't initialise structure: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( !mysql_connect( &dbconn, "", ZM_DB_USERB, ZM_DB_PASSB ) )
|
if ( !mysql_connect( &dbconn, ZM_DB_SERVER, ZM_DB_USERB, ZM_DB_PASSB ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't connect to server: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
}
|
}
|
||||||
if ( mysql_select_db( &dbconn, ZM_DATABASE ) )
|
if ( mysql_select_db( &dbconn, ZM_DB_NAME ) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
fprintf( stderr, "Can't select database: %s\n", mysql_error( &dbconn ) );
|
||||||
exit( mysql_errno( &dbconn ) );
|
exit( mysql_errno( &dbconn ) );
|
||||||
|
|
Loading…
Reference in New Issue