Problems with Mysql

Support and queries relating to all previous versions of ZoneMinder
Locked
germandms
Posts: 40
Joined: Mon Oct 03, 2005 2:19 pm

Problems with Mysql

Post by germandms »

when I execute
# mysql < db/zmschema.sql -p
Enter password:
ERROR 1136 (21S01) at line 378: Column count doesn't match value count at row 1

I have suse 10.0 kernel 2.6.13
and /zm-1.21.4

Thank You
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Try replacing the db file with this one and recompile.
http://www.computerntelecom.com/pub/zmschema.sql.z

Regards,
Cordel

[Edit] heres the patch

Code: Select all

--- 	zmschema.sql.z.orig 2005-11-07 04:03:21.000000000 -0800
+++ zm-1.21.4/db/zmschema.sql.z	2005-11-14 12:34:01.000000000 -0800
@@ -374,9 +374,9 @@
 
 --
 -- Create a default admin user.
 --
-insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit',NULL);
+insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','High',NULL);
 --
 -- Add in a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though
 --
 insert into Filters values ('PurgeWhenFull','trms=2&obr1=&cbr1=&attr1=Archived&op1==&val1=0&cnj2=and&obr2=&cbr2=&attr2=DiskPercent&op2=>=&val2=95&sort_field=Id&sort_asc=1&limit=5',0,0,0,0,0,'');
Last edited by cordel on Mon Nov 14, 2005 8:54 pm, edited 2 times in total.
germandms
Posts: 40
Joined: Mon Oct 03, 2005 2:19 pm

new error

Post by germandms »

now have other error

ERROR 1048 (23000) at line 378: Column 'MonitorIds' cannot be null

thank you cordel
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Okay this may sound funney but I don't know why. On my database MonitorID colum alows NULLs as it should. If you put values here then this would restrict the admin to the monitorID placed here. :oops:

Unless....
New patch and I reuped the file to the server with the changes. you'll need to drop the database.

Code: Select all

--- zm-1.21.4/db/zmschema.sql.z.orig	2005-11-07 04:03:21.000000000 -0800
+++ zm-1.21.4/db/zmschema.sql.z	2005-11-14 12:57:08.000000000 -0800
@@ -333,9 +333,9 @@
   Control enum('None','View','Edit') NOT NULL default 'None',
   Monitors enum('None','View','Edit') NOT NULL default 'None',
   System enum('None','View','Edit') NOT NULL default 'None',
   MaxBandwidth varchar(16) NOT NULL default '',
-  MonitorIds tinytext NOT NULL,
+  MonitorIds tinytext default NULL,
   PRIMARY KEY  (Id),
   UNIQUE KEY UC_Id (Id),
   UNIQUE KEY UC_Username (Username)
 ) TYPE=MyISAM;
@@ -374,9 +374,9 @@
 
 --
 -- Create a default admin user.
 --
-insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit',NULL);
+insert into Users values ('','admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','High',NULL);
 --
 -- Add in a sample filter to purge the oldest 5 events when the disk is 95% full, delete is disabled though
 --
 insert into Filters values ('PurgeWhenFull','trms=2&obr1=&cbr1=&attr1=Archived&op1==&val1=0&cnj2=and&obr2=&cbr2=&attr2=DiskPercent&op2=>=&val2=95&sort_field=Id&sort_asc=1&limit=5',0,0,0,0,0,'');
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Also please let me know if this works out 8)
Regards,
Cordel
germandms
Posts: 40
Joined: Mon Oct 03, 2005 2:19 pm

I work the compilation

Post by germandms »

I work the compilation
the data base that I create volume the name of ZM_DB_NAME


chkconfig --add zm
zm: unknown service
zm: not a runlevel service

when I enter http://localhost/zm

Fatal error: Call to undefined function: session_start() in /srv/www/htdocs/zm/zm.php on line 159

my file zm.php

session_start();

if ( !$_SESSION['format'] )
{
$_SESSION['format'] = $format;
$_SESSION['cookies'] = $cookies;
$_SESSION['device'] = $device;
if ( $cookies )
{
setcookie( "format", $format );
setcookie( "cookies", $cookies );
}
}

require_once( "zm_$format.php" );
germandms
Posts: 40
Joined: Mon Oct 03, 2005 2:19 pm

MORE

Post by germandms »

The compilations the I did with
mysql < zmschema.sql.z -p

thank you
furbitso
Posts: 1
Joined: Fri Jan 06, 2006 2:38 am

Post by furbitso »

Cordel,

I can confirm that the second patch you posted installs with no errors. I am using zm-1.21.4 with mysql-server-4.0.24-10ubuntu2.

Would be great if you could update the link to reflect the newest patch.

Thanks,

Paul
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

I belive if you check the zm-1.21.4 you downloaded, the patch should already be there now and not required.

Corey
Locked