Debian Wheezy amd64 install - ERROR 1142 (42000)

Support and queries relating to third party Live CDs and DVD, VM images and other packaged distributions
Post Reply
FloppyDisk
Posts: 9
Joined: Sat Feb 06, 2016 1:41 am

Debian Wheezy amd64 install - ERROR 1142 (42000)

Post by FloppyDisk »

Hi,

I'm slowly working my way through a debian wheezy amd64 install of zoneminder_1.28.0-wheezy_amd64.deb. I've been following the directions on github (same as wiki install).

I have an issue with mysql rights listed below:
-----------------------------------------------------------------------------------
dpkg -i /root/zoneminder_1.28.0-wheezy_amd64.deb; apt-get install -f;

Initiating database upgrade to version 1.29.0 from version 1.28.1
Upgrading database to version 1.29.0
Loading config from DB
Saving config to DB
Upgrading DB to 1.28.99 from 1.28.1
ERROR 1142 (42000) at line 393: CREATE command denied to user 'zmuser'@'localhost' for table 'Servers'
Output: Column Id exists in States

Column Id exists in States
Column IsActive exists in States
Column IsActive exists in States
Command 'mysql -hlocalhost -uzmuser -pzmpass zm < /usr/share/zoneminder/db/zm_update-1.28.99.sql' exited with status: 1
dpkg: error processing zoneminder (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)
--------------------------------------------------------------------------------

This seems like I have a 'rights' issue for the user zmuser to to access the mysql database, but i haven't been able to get around it:-(


Here's some of the things I've tried:
EDIT FILES LISTED in the UBUNTU install STEP 8 here: http://zoneminder.readthedocs.org/en/la ... buntu.html

If you have, go to zoneminder/www/api/app/Config & Edit database.php
There is a class there called DATABASE_CONFIG - change the $default array to reflect your new details. Example:
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'mynewDBusername',
'password' => 'mynewDBpassword'
'database' => 'zm',
'prefix' => '',
//'encoding' => 'utf8',
);

I found 'different' files in the web folder (not www), but I couldn't edit them (as root). At least I tried a gedit database.php.'something here forgot it'


mysql> SELECT USER(),CURRENT_USER();
+----------------+----------------+
| USER() | CURRENT_USER() |
+----------------+----------------+
| root@localhost | root@localhost |
+----------------+----------------+
1 row in set (0.55 sec)

mysql> SOURCE share/mysql_fix_privilege_tables.sql
ERROR:
Failed to open file 'share/mysql_fix_privilege_tables.sql', error: 2
mysql> mysql_fix_privilege_tables.sql
->
-> exit
-> q
-> quit
-> ls
-> ^CCtrl-C -- exit!
Aborted

Does anyone have a suggestion that would help me get past this?

Thanks - Mark
FloppyDisk
Posts: 9
Joined: Sat Feb 06, 2016 1:41 am

Re: Debian Wheezy amd64 install - ERROR 1142 (42000)

Post by FloppyDisk »

So maybe I got past it with the command below from the mysql monitor enterprise 5.5 help pages:

mysql> GRANT ALL ON zm.* TO 'zmuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)

I also did the SHOW DATABASES; command to show that the ZM database is at least there:
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| zm |
+--------------------+
4 rows in set (0.00 sec)

STILL NOT WORKING:
When I goto a browser and type http://localhost/zm, I get a 404 error.

I did issue the "dpkg -i /root/zoneminder_1.28.0-wheezy_amd64.deb; apt-get install -f;" and got a zoneminder running. So, something is working. Still not there yet. Will keep trying, I saw some stuff about apache, Will get another drink, the wife is in bed so committed to this...
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Debian Wheezy amd64 install - ERROR 1142 (42000)

Post by SteveGilvarry »

So you found below , which is a change from 1.28.1 to 1.29.0
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"

I know you are upgrading but is it a working install? If it wasn't I would be point you at Apache config as next step to check out. The standard 1.28.1 debian package had an example config and details in the readme to configure it.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
FloppyDisk
Posts: 9
Joined: Sat Feb 06, 2016 1:41 am

Re: Debian Wheezy amd64 install - ERROR 1142 (42000)

Post by FloppyDisk »

Steve,

Thanks for the reply.

It is NOT a working install. And, from what I learned, it seems to be an apache setup issue. Specifically, the config files linked w/ the ln command seem to be off.
The standard 1.28.1 debian package had an example config and details in the readme to configure it.
I did not know that - heading there now. Thank you!

I'm wondering if I have to unlink some of the files (the apache and zoneminder confg) that I already did. I wasn't familiar w/ the 1.28.1 debian package and was reading teh install instructions (http://zoneminder.readthedocs.org/en/la ... buntu.html) because I didn't know what to do.

Regards,
Mark
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Debian Wheezy amd64 install - ERROR 1142 (42000)

Post by SteveGilvarry »

Example Apache conf below, might be lucky and find it in /etc/apache2/sites-available/zoneminder
https://github.com/ZoneMinder/ZoneMinde ... inder.conf

Are you wedded to using Debian?
If so start on Jessie, add jessie-backports and you can install 1.28.1 using apt-get. For 1.29.0 you might be better waiting for package maintainer, or we might have a script to allow you to build your own update package coming.

If not swap to Ubuntu as the PPA process is just easier to follow bbunge's guide.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
FloppyDisk
Posts: 9
Joined: Sat Feb 06, 2016 1:41 am

Re: Debian Wheezy amd64 install - ERROR 1142 (42000)

Post by FloppyDisk »

Hi,

Thanks for the link.

No, I'm not married to Debian, but my only other endeavor into the linux world is linuxcnc and they need to 'patch' in a real-time kernel so they're usually behind the distro releases and went away from Ubuntu a few years back. I was hoping to stay w/ one 'distro' and own that, but I can look at this as an opportunity to get back to Ubuntu. I'll go that route for now. Just need it to work!

Thanks for your replies, I appreciate it. I struggle w/ the setup of ZM on debian and when I look at Ubuntu installs, it's just different enough to confuse my small head.

Thanks,
Mark
FloppyDisk
Posts: 9
Joined: Sat Feb 06, 2016 1:41 am

Re: Debian Wheezy amd64 install - ERROR 1142 (42000)

Post by FloppyDisk »

I switched to Ubuntu 14.04 and I have zoneminder running! Thanks for the help.

Mark
Post Reply