MySQCL C Library

Support and queries relating to all previous versions of ZoneMinder
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: MySQCL C Library

Post by zoneminder »

If your php is not compiled with php support then no amount of fidlign with ZM configure options will fix it. You will need to either rebuild php and include mysql, or if your php has mysql compiled in as a shared object then you will need to get the correct library file and put it in the php modules directory.

To check what state your php is in just create a small file, say called 'debug.php' and add the following to it

<?php

phpinfo();

?>

then access it in your browser and look for any references to mysql. If you are lucky you will see it has it compiled as shared in which case all you need to do is find the right module and put it in. Check the output first before we go any further. The other thing that it might be is that you have an old version of mysql that needs to use the mysql_connect function and not mysql_pconnect in which case you will need to make a small change to line 22 of zm_db.php.

The normal ZM configure options for a regular RH8 system would probably just be something like

./configure --with-mysql=/usr --with-webdir=/var/www/html --with-cgidir=/var/www/cgi-bin

but as I said, the problem you have now is something that is entirely unrelated to ZM as such.

Phil,
carrthomas
Posts: 42
Joined: Tue Nov 25, 2003 10:11 pm

Re: MySQCL C Library

Post by carrthomas »

Hi Phil,

Thanks for more guidance, I am very grateful. I installed php-mysql rpm and restarted .

Good news:-

I have the zone minder console. I am so happy!



Bad news:-

The only button that appears to work is the Refresh button updating the browser.

Clicking Add new monitor button does not stimulate any action.


Any clues please.

Thanks a million.

Peter
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: MySQCL C Library

Post by zoneminder »

Most things that ZM does from the console involve new windows popping up so make sure that you don't have any popup blockers active.

The other thing to check is that the rest of the screen looks ok. If it looks a little odd then you may need to enable 'short_open_tags' in your php.ini file.

Phil,
tray
Posts: 12
Joined: Tue Nov 25, 2003 9:31 am

Re: MySQCL C Library

Post by tray »

Hello,

Great to hear you've got the consol running Peter :)
I've managed to get the ./configure command to run, so now I'm onto sorting out the mysql users side of things. So back to where you were last tuesday Peter.

Some of the readme is a bit ambiguous, but still combine that with the fact end users can't follow instructions, and you have a never ending loop.
carrthomas
Posts: 42
Joined: Tue Nov 25, 2003 10:11 pm

Re: MySQCL C Library

Post by carrthomas »

Hi Guys,

Thanks Phil.

Trevor, I am Glad you fixed your problem. Keep going........
I am gradually moving forward too.


Good news

Enabling 'short open tags' in php.ini has breathed life into the console.

I then added a monitor successfully



Bad news

The Monitor image from my camera freezes up after maybe 10 seconds of streaming.



Peter
tray
Posts: 12
Joined: Tue Nov 25, 2003 9:31 am

Re: MySQCL C Library

Post by tray »

Hello,

Sorry it seems I need "hand holding" for the installation of this program

Here's my progress to date.

[root@localhost zm-0.9.16]# perl ./zmconfig.pl -noi
Loading config from 'zmconfig.txt'
Loading config from DB
DBI connect('database=zm;host=localhost','root',...) failed: Unknown database 'zm' at ./
zmconfig.pl line 1277
Error: unable to load options from database: Unknown database 'zm'
Saving config to 'zmconfig.txt'
Saving config to DB
DBI connect('database=zm;host=localhost','root',...) failed: Unknown database 'zm' at ./
zmconfig.pl line 1181
Error: unable to save options to database: Unknown database 'zm'
Generating 'src/zm_config_defines.h'
Processing 'src/zm_config.h'
Processing 'web/zm_config.php'
Processing 'scripts/zmdc.pl'
Processing 'scripts/zmwatch.pl'
Processing 'scripts/zmaudit.pl'
Processing 'scripts/zmfilter.pl'
Processing 'scripts/zmx10.pl'
Processing 'scripts/zmpkg.pl'
Processing 'scripts/zmvideo.pl'
Processing 'scripts/zm'
Processing 'db/zmschema.sql'

[root@localhost zm-0.9.16]# mysql mysql < zmschema.sql
bash: zmschema.sql: No such file or directory
[root@localhost zm-0.9.16]# mysql mysql<db/zmschema.sql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

Any ideas of I need to use to access the zmschemq.sql file??
tray
Posts: 12
Joined: Tue Nov 25, 2003 9:31 am

Re: MySQCL C Library

Post by tray »

Hello,

Sorry it seems I need "hand holding" for the installation of this program

Here's my progress to date.

[root@localhost zm-0.9.16]# perl ./zmconfig.pl -noi
Loading config from 'zmconfig.txt'
Loading config from DB
DBI connect('database=zm;host=localhost','root',...) failed: Unknown database 'zm' at ./
zmconfig.pl line 1277
Error: unable to load options from database: Unknown database 'zm'
Saving config to 'zmconfig.txt'
Saving config to DB
DBI connect('database=zm;host=localhost','root',...) failed: Unknown database 'zm' at ./
zmconfig.pl line 1181
Error: unable to save options to database: Unknown database 'zm'
Generating 'src/zm_config_defines.h'
Processing 'src/zm_config.h'
Processing 'web/zm_config.php'
Processing 'scripts/zmdc.pl'
Processing 'scripts/zmwatch.pl'
Processing 'scripts/zmaudit.pl'
Processing 'scripts/zmfilter.pl'
Processing 'scripts/zmx10.pl'
Processing 'scripts/zmpkg.pl'
Processing 'scripts/zmvideo.pl'
Processing 'scripts/zm'
Processing 'db/zmschema.sql'

[root@localhost zm-0.9.16]# mysql mysql < zmschema.sql
bash: zmschema.sql: No such file or directory
[root@localhost zm-0.9.16]# mysql mysql<db/zmschema.sql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

Any ideas of what I need to use to access the zmschemq.sql file??
carrthomas
Posts: 42
Joined: Tue Nov 25, 2003 10:11 pm

Re: MySQCL C Library

Post by carrthomas »

Hi Trevor,

It looks like you have not made the new zm database that you need and rerunning zmconfig has confirmed it.

I think mysql is ugly when you first meet it ....... the mysql book I bought to help me last week says in the introduction that you may have trouble working with it initially!

Go back and make zm database

Check you have made it with:- 'show databases' in mysql

Make the users and passwords you want

There is a table you can check for authorisations too (see earlier entry here from Phil).

rerun zmconfig.pl -noi

Keep a beady eye on the syntax ...watch out for these critters :- " ' " and these " ; " in the expression to generate users.

Syntax is unforgiving as usual.


[ oh and .....make sure the mysql daemon is running. ]


I know this is a case of "the blind leading the partially sighted "....but I hope it helps....:-).


Peter
tray
Posts: 12
Joined: Tue Nov 25, 2003 9:31 am

Re: MySQCL C Library

Post by tray »

Hi Peter,

I figure you're right I need to create the database. I thought the schema.sql file would provide the structure for mysql to create the tables required???

Following that logic,
[root@localhost zm-0.9.16]# mysql mysql < zmschema.sql
bash: zmschema.sql: No such file or directory

the top line would use the schema.sql file to create the database. Did you follow the readme exactly as I have done above or did you do something else.

Is the next best step running "perl ./zmconfig.pl" again? I've run it a couple of times already & can't see much to change!??!

Trevor
PS: I'm not worried about the 'the blind leading', from experience I'm here looking for small pointers & hints that will help me solve the problem. So if you have stubbed you toe on the second step let me know so that I may avoid the same thing.
carrthomas
Posts: 42
Joined: Tue Nov 25, 2003 10:11 pm

Re: MySQCL C Library

Post by carrthomas »

Trevor,

I'm not infront of my home computer, so I can't recall the info I used. But....

You wrote:- [root@localhost zm-0.9.16]# mysql mysql < zmschema.sql
bash: zmschema.sql: No such file or directory

The bash shell has not recognized your command. (remember you are wanting to talk to the mysql service)

So I think you need the mysql server running. (the server provides the service)

Try

$ ps -aux and see if the service is running


If not then

#/etc/rc.d/init.d/mysqld&


If that does not work try googling "mysql_safe start" for guidance.


your mysql commands might then work

You also might need to be in the right directory to send the commands to mysql once the mysql server is running (or alternatively put them in your path environment)

Peter.


PS This information might be complete rubbish...and I am not confident ...but from memory it feels right. I've never tried helping (or hindering )anyone before!!!!!

pps

Try putting keywords in the Zoneminder forum dialogue box. I found it is surprisingly useful for bringing up useful threads to solve problems.

Google is your friend too for mysql etc
carrthomas
Posts: 42
Joined: Tue Nov 25, 2003 10:11 pm

Re: MySQCL C Library

Post by carrthomas »

Hi Trevor,

I was at the office earlier.

Msql is a service

Peter
carrthomas
Posts: 42
Joined: Tue Nov 25, 2003 10:11 pm

Re: MySQCL C Library

Post by carrthomas »

Hi guys,

I left ZoneMinder running all day while at the office. Came home to this:-


[root@localhost zm-0.9.16]# /usr/bin/safe_mysqld: line 273: 1681 Killed
$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION
--datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking >>$err_log
2>&1

Number of processes running now: 0
031208 21:42:40 mysqld restarted
[root@localhost zm-0.9.16]#

I dunno what happened while I was out!

Anyway:-

I would like Cambozola to to work better. Mail from motion mailing list also suggests that no one has got to the bottom of this freeze screen problem!
Suggestion is that maybe a TCP/IP timeout lurking in there tripping Cambozola up?!


Peter
tray
Posts: 12
Joined: Tue Nov 25, 2003 9:31 am

Re: MySQCL C Library

Post by tray »

Hello Peter,

A slow second but I've followed the remaining make instructions and have made it to the console.

Now I've just got buy a camera, and attempt to get that running. Perhaps..I should have got the camera going first??

Funny thing in the consol page I have the following:
Warning: Division by zero in /var/www/html/zm_html_view_console.php on line 54

Thanks Peter, and Philip. I've learnt alot, and gained some confidence using linux.
Locked