Page 1 of 1

Populating the Database

Posted: Fri Feb 24, 2006 8:32 pm
by ice_neo2k
I'm so excited about this software, been beevering away at it all day but i've hit a rock atm.

I believe I've installed everything correctly. But the databsae is not populated with any data. When I try to start zm (from the scripts directory "./zm start") I get:

Output of ./zm start
Starting ZoneMinder: DBD::mysql::st execute failed: Table 'mscam.Config' doesn't exist at /usr/lib/perl5/site_perl/5.8.6/ZoneMinder/Config.pm line 91.
Can't execute: Table 'mscam.Config' doesn't exist at /usr/lib/perl5/site_perl/5.8.6/ZoneMinder/Config.pm line 99
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/ZoneMinder/Config.pm line 99.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.6/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.6/ZoneMinder.pm line 33.
Compilation failed in require at /usr/local/bin/zmpkg.pl line 45.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 45.
I gather that this is because there is no data in the database.

zm.conf:
# Current version of ZoneMinder
ZM_VERSION=1.22.0

# Path to build directory, used mostly for finding DB upgrade scripts
ZM_PATH_BUILD=/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0

# Build time, used to record when to trigger various checks
ZM_TIME_BUILD=1140800784

# Path to ZoneMinder binaries
ZM_PATH_BIN=/usr/local/bin

# Path to ZoneMinder libraries (none at present, for future use)
ZM_PATH_LIB=/usr/local/lib

# Path to ZoneMinder configuration (this file only at present)
ZM_PATH_CONF=/usr/local/etc

# Path to ZoneMinder web files
ZM_PATH_WEB=/srv/www/htdocs/ms

# Path to ZoneMinder cgi files
ZM_PATH_CGI=/srv/www/cgi-bin

# Username and group that web daemon (httpd/apache) runs as
ZM_WEB_USER=wwwrun
ZM_WEB_GROUP=www

# ZoneMinder database hostname or ip address
ZM_DB_HOST=localhost

# ZoneMinder database name
ZM_DB_NAME=mscam

# ZoneMinder database user
ZM_DB_USER=root

# ZoneMinder database password
ZM_DB_PASS=hidden
How do I go about populating the database? Isn't this done automatically during one of the scripts? zmupdate.pl gives me the same error as above. I read somewhere about an zminit, but I cant find that, I assume it's from an older version.

Also I'm a bit confused as to whether my installation finished correctly. The last few lines of the 'make install' are:
Making install in db
make[1]: Entering directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0/db'
make[2]: Entering directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0/db'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0/db'
make[1]: Leaving directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0/db'
make[1]: Entering directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0'
make[2]: Entering directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0'
test -z "/usr/local/etc" || mkdir -p -- "/usr/local/etc"
/usr/bin/install -c -m 644 'zm.conf' '/usr/local/etc/zm.conf'
make install-data-hook
make[3]: Entering directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0'
( cd /usr/local/etc; chown wwwrun:www zm.conf; chmod 600 zm.conf )
( if ! test -e /var/run; then mkdir /var/run; fi )
( if ! test -e /var/run/zm; then mkdir /var/run/zm; fi; chown wwwrun:www /var/run/zm; chmod u+w /var/run/zm )
make[3]: Leaving directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0'
make[2]: Leaving directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0'
make[1]: Leaving directory `/srv/files/temp/ZoneMinder-1.22.0/ZoneMinder-1.22.0'
It just seems to all end ever so abruptly. (I'm a newbie to Linux if you haven't guessed already).

My system is:
SuSE Linux 9.3 Professional
Tab Window Manager
VIA C3 800MHz, 256Mb RAM
zoneminder-1.22.0
mysql-4.1.10a
perl-5.8.6
kernel-2.6.11.4-20a-default

If you need any more information just say. Any help would be greatly appreciated.

Thanks,
Mik.

Posted: Fri Feb 24, 2006 10:32 pm
by bosskong
I'm not really sure what the problem is, but since noone else has replied yet, I'll give it a shot. Have you done the following? (from the Zoneminder docs)
---------
mysql mysql < db/zm_create.sql

mysql mysql

grant select,insert,update,delete on <database name>.* to '<database user>'@localhost identified by '<database password>';

quit

mysqladmin reload
---------

Posted: Fri Feb 24, 2006 11:15 pm
by zoneminder
This is correct assuming you are using the source release rather than an rpm, which should do the db creation for you.

Posted: Fri Feb 24, 2006 11:37 pm
by ice_neo2k
bosskong wrote: Have you done the following? (from the Zoneminder docs)
---------
mysql mysql < db/zm_create.sql

mysql mysql

grant select,insert,update,delete on <database name>.* to '<database user>'@localhost identified by '<database password>';

quit

mysqladmin reload
---------
Oh no.. I created the database with phpMyAdmin, but looking at that code now I realise that I shouldn't have...
zoneminder wrote:This is correct assuming you are using the source release rather than an rpm, which should do the db creation for you.
Yes, I'm using the source, but when I saw 'create the database' in the docs I loaded up phpMyAdmin because that's what I'm used to. Now I realise my mistake.

Thanks a lot for correcting my ways, it's all working perfectly now!
:D
I'm going to have so much fun...

Posted: Mon Feb 27, 2006 5:51 pm
by zoneminder
No problem. Enjoy :D