zm_database_init does not work - permission error

Support and queries relating to all previous versions of ZoneMinder
Locked
baxterdmutt
Posts: 25
Joined: Tue Sep 16, 2008 3:47 am

zm_database_init does not work - permission error

Post by baxterdmutt »

I have been trying to run "zm_database_init" as instructed in the suse rpm install. I get a permission error. I don't think the db even gets created. I tried modifying zm.conf, but that makes no difference. I am at a loss. Any help would be greatly appreciated. I have tried uninstalling and then reinstalling the rpm without success. Mysql and Apache2 are started.

Where is the DB stored. Should I just delete it and try again?

Thanks
User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

Post by monex »

Hello,

it is required to run zm_database_init as root.

Code: Select all

su -
<get propmted for root password>

zm_database_init
hope this helps
Image
baxterdmutt
Posts: 25
Joined: Tue Sep 16, 2008 3:47 am

Post by baxterdmutt »

monex wrote:Hello,

it is required to run zm_database_init as root.

Code: Select all

su -
<get>

zm_database_init
hope this helps
Thanks, but I was already doing that. When I run zm_database_init, I am asked to set up as root or as zm_user. If I chose zm_user I am asked for a password twice. If I chose to aet up as root or zm_user the result is always this:
ERROR 1045 (28000): Access denied for user 'root@localhost' (using password: YES)
SQL ERROR exiting.

The last time I did it it asked "no lockfile found, proceed anyway? [y/N]

I have been there before and removed and reinstalled the rpm package a couple times now.

Help.
User avatar
monex
Posts: 169
Joined: Mon Jan 22, 2007 1:10 pm

Post by monex »

did you set up the mysql database correctly?

before you can use zm_database_init you have to start mysql and set up the mysql root password:

Code: Select all

/usr/bin/mysqladmin -u root -h <hostname> password <password>
edit .my.cnf in ~/root and enter the correct mysql root password or remove that file (it will be recreated from zm_database_init with the values entered there). Then run zm_database_init as root.

During the setup process a new mysql user zm_admin will be crated (no system user and only with right for the zm database). You have to set a new password for this user during installation (this is why you where you get called twice for the password). The zonemidner config file (/etc/zm.conf) is edited by the script and your entered password is updated there (because otherwise zonemidner has no access to the database).

If you get something like:

Code: Select all

The last time I did it it asked "no lockfile found, proceed anyway? [y/N] 
during execution and you are sure that the database isn't installed correctly enter "y" to proceed. But if your database is installed correctly (zoneminder works as desired and you have events in your database) all events/settings gets lost because the database is recreated again.

hope this helps
Image
baxterdmutt
Posts: 25
Joined: Tue Sep 16, 2008 3:47 am

Post by baxterdmutt »

monex wrote:did you set up the mysql database correctly?

before you can use zm_database_init you have to start mysql and set up the mysql root password:

Code: Select all

/usr/bin/mysqladmin -u root -h <hostname> password <password>
edit .my.cnf in ~/root and enter the correct mysql root password or remove that file (it will be recreated from zm_database_init with the values entered there). Then run zm_database_init as root.

During the setup process a new mysql user zm_admin will be crated (no system user and only with right for the zm database). You have to set a new password for this user during installation (this is why you where you get called twice for the password). The zonemidner config file (/etc/zm.conf) is edited by the script and your entered password is updated there (because otherwise zonemidner has no access to the database).

If you get something like:

Code: Select all

The last time I did it it asked "no lockfile found, proceed anyway? [y/N] 
during execution and you are sure that the database isn't installed correctly enter "y" to proceed. But if your database is installed correctly (zoneminder works as desired and you have events in your database) all events/settings gets lost because the database is recreated again.

hope this helps
Thanks, I'll try that. Is there anywhere that tell one how to set Mysql up first before proceeding. It doesn't seem to be mentioned in any of the Zoneminder docs. A set by stp guide would be really helpfull.

Thanks
baxterdmutt
Posts: 25
Joined: Tue Sep 16, 2008 3:47 am

Fixed it

Post by baxterdmutt »

I don't know what is was, but after geting fed up and reinstalling Suse 11.0 and all the applications from scratch, everything worked just perfectly. :shock:

Thanks for all your help. I'm looking forward to when my new camera gets here tomorrow so I can see this working!

:D
Locked