Page 1 of 1

Starting ZoneMinder and MySQL-Apache authentification

Posted: Sat May 30, 2009 12:13 am
by bertlf
Hello,
I am not a LINUX pro. I understand very little but desire to make progress.
I have this Comart card that has been sitting around unused and wanted to try ZoneMinder.
I have a working install of Fedora
KDE 3.5.10-1.fc8 Fedora
Linux Kernel 2.6.26.8-57.fc8
I have installed MySQL, Apache, ffmpeg, and everything else I saw that was required.
I think my main issue is no ability to login to mysql?
The error below is generated from the services applet when starting zoneminder.
I know I will have issues to deal with on this HiCap25 card but for now I need to get past these other items. Then I might try a web or IP cam.

Thanks Bert

zoneminder failed. The error was: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/lib/perl5/vendor_perl/5.8.8/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/lib/perl5/vendor_perl/5.8.8/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmupdate.pl line 48.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 48. 8) 8)

Posted: Sat May 30, 2009 12:52 am
by kingofkya
i wont tell you exactly how (you have to know why and how) but feel free to ask questions if you run into problems

Take a look at

http://dev.mysql.com/doc/refman/5.0/en/ ... sions.html
http://www.devdaily.com/blog/post/linux ... e-command/

and

and you need to edit this file zm.conf

original password

Posted: Sat May 30, 2009 3:30 pm
by bertlf
kingofkya,
thanks for your response.
So is this a case of I changed the password for root at some point after the Fedora install, which i did do. Does this cause issues with MySQL not being updated to the root password change?

When I use the terminal and type "mysql" I do get a prompt for mysql and can run some commands. I can see the status of the mysql server for instance. I read the first link you posted and was confused. I also have read a few links from searches that point out login issues from encryption levels being different. I think the link you have refers to mysql verson before mine, would that be an issue in using your solution? I just want to be sure before applying that solution, I don't want to make this worse.
Thanks Bert

Posted: Sat May 30, 2009 5:08 pm
by kingofkya
Do you still know the pass?


if not see below



Code: Select all

 Log on to your system as the Unix mysql user that the mysqld server runs as.
type sudo su

Code: Select all

2.

      Locate the .pid file that contains the server's process ID. The exact location and name of this file depend on your distribution, host name, and configuration. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/. Generally, the file name has an extension of .pid and begins with either mysqld or your system's host name.

      You can stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the path name of the .pid file in the following command:

      shell> kill `cat /mysql-data-directory/host_name.pid`

      Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command.
   3.

the above can be changed to

/etc/init.d/mysqld stop

Create a text file and place the following statements in it. Replace the password with the password that you want to use.

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

The UPDATE and FLUSH statements each must be written on a single line. The UPDATE statement resets the password for all existing root accounts, and the FLUSH statement tells the server to reload the grant tables into memory.
4.

Save the file. For this example, the file will be named /home/me/mysql-init. The file contains the password, so it should not be saved where it can be read by other users.
5.

Start the MySQL server with the special --init-file option:

shell> mysqld_safe --init-file=/home/me/mysql-init &

The server executes the contents of the file named by the --init-file option at startup, changing each root account password.
6.

After the server has started successfully, delete /home/me/mysql-init.

You should now be able to connect to MySQL as root using the new password.

Alternatively, on any platform, you can set the new password using the mysql client (but this approach is less secure):

1.

Stop mysqld and restart it with the --skip-grant-tables option.
2.

Connect to the mysqld server with this command:

shell> mysql

3.

Issue the following statements in the mysql client. Replace the password with the password that you want to use.

mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
-> WHERE User='root';
mysql> FLUSH PRIVILEGES;

Thanks Very Much

Posted: Sat May 30, 2009 5:34 pm
by bertlf
Wow I am in!
New pass and ready to move forward.
The mysql admin applet is nice, very similar to the windows stuff I am more familiar with. I am going to reinstall zoneminder if need be after first just trying to restart.
Thanks Again

Posted: Sat May 30, 2009 6:21 pm
by kingofkya
there is a file caller zm.sql just import that into mysql

zm_create.sql

Posted: Sun May 31, 2009 3:12 am
by bertlf
I ran zm_create.sql from the mysql query tool and it made the db.
Then I worked on apache contfd and zm.conf and got it working.
I also ran the svn lmarch live cd.
It came up as latest version and found my dvr card (I think) cause it said something like dev0....... where in fedora with 1.2.2..... version I do not get any devices found in the opening window.
This has got me working on building a dedicated box or wanting to lean fedora out so this will be the mian use of this box. Just dug out my packrat boxes and am installing a scsi 10krpm 18.2 gb for linux and will use another 18.2 7K200rpm for storage or should I keep the slow 60GB ATA for storage?
I also thought about blowing the whole thing away now that I am understading more and using centos.
I really want a box to do mostly just zoneminder but I guess this Fedora current setup is useful for building linux skills.
What are your thoughts?
Is there an easy way to upgrade to 1.2.24?

Thanks Bert

Posted: Sun May 31, 2009 5:17 pm
by kingofkya

yes lmarch

Posted: Sun May 31, 2009 10:12 pm
by bertlf
yes that is how I tried 1.24 version with the svn live zm 1.24
I am really leaning towards CentOS - fedora and dual boot.
That way I can still play wiith what I have now and install with a little more knowledge and go for dedicated CentOS/ZM server with better package choices made at install.
I still need to read up on how to make the phillips sa41766 rev01 Comart card work. I read a post about editing the V4L output of the card to ZM but there was not a lot of detail in that post. I added 512mb of ram and now the system is much better. I am going to use the scsi u160 for the CentOS drive. I know there are better cards to use but money is big issues these days and I have lots of used gear laying around not being used.

Posted: Mon Jun 01, 2009 12:52 am
by kingofkya
yeah cheap stuff is hard to find my preference is a raid 1 for the os and a raid0 or lvm for zoneminders events and mysql.