Page 1 of 1

Ubuntu 16.04 upgrade to 1.30 failing trying to access mysql as root.

Posted: Sun Oct 30, 2016 4:36 pm
by davidsmoot
Having a problem with upgrading Zoneminder to 1.30 on a Ubuntu 16.04 platform. I followed the wiki instructions at
https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way adapted for the fact I was an upgrade not fresh install.

apt seems to want to install the correct package but it is bombing on accessing mysql with root privileges.

Code: Select all

sudo apt-get dist-upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Setting up zoneminder (1.30.0-xenial-2016101901) ...
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
dpkg: error processing package 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)
Googling suggested adding a file called ".my.cnf" to my home directory or the root directory with mysql root credentials. Tried adding that file to my home, to /, and to /root with no luck.

Any suggestions on how to proceed? I thought about trying to change the root password for mysql to no password but I am worried about screwing that up.

Thanks for you help, David

Re: Ubuntu 16.04 upgrade to 1.30 failing trying to access mysql as root.

Posted: Sun Oct 30, 2016 9:11 pm
by SteveGilvarry
Actual upgrade guides in case you missed something https://wiki.zoneminder.com/Common_Issu ... u#Upgrades

Re: Ubuntu 16.04 upgrade to 1.30 failing trying to access mysql as root.

Posted: Mon Oct 31, 2016 3:34 am
by davidsmoot
Looked at the link you provided. Disabled all the zoneminder repos in /etc/apt/source.list.d. The first step in the section for 16.04 upgrade to 1.30 failed:

Code: Select all

# add-apt-repository ppa:iconnor/zoneminder
Cannot add PPA: 'ppa:~iconnor/ubuntu/zoneminder'.
The user named '~iconnor' has no PPA named 'ubuntu/zoneminder'
Please choose from the following available PPAs:
 * 'zoneminder':  ZoneMinder Stable
 * 'zoneminder-cluster':  ZoneMinder Cluster
 * 'zoneminder-feature-h264-videostorage':  ZoneMinder H264 Snapshots
 * 'zoneminder-master':  ZoneMinder Master Snapshots
 * 'zoneminder-multi-server':  ZM Multi Server
 * 'zoneminder-storageareas':  ZoneMinder with Storage Areas
Thanks for trying to help, any more ideas?

Re: Ubuntu 16.04 upgrade to 1.30 failing trying to access mysql as root.

Posted: Mon Oct 31, 2016 1:18 pm
by bbunge
I just added the PPA repository with the command: add-apt-repository ppa:iconnor/zoneminder
and it worked. You must have messed something up.

Re: Ubuntu 16.04 upgrade to 1.30 failing trying to access mysql as root.

Posted: Sat Nov 05, 2016 12:49 am
by davidsmoot
Turns out I totally mischaracterized the problem. My mistake and my apologies. I don't know how I created the problem but I got a brute force solution that finally work.

I was actually running 1.30 with the latest schema. ZM was running fine, zmupdate.pl stated I was at the latest schema. But apt-get kept telling me the package was not fully installed and I could not convince it otherwise.

I googled, I swore, but eventually this appeared to work with no side effects:
1) backup /var/lib/dpkg/info/zoneminder.postinst
2) delete /var/lib/dpkg/info/zoneminder.postinst
3) run apt-get update. It warns me about the incomplete install but this time the install finishes sucessfully.
4) restore /var/lib/dpkg/info/zoneminder.postinst
5) type this post
6) grab a beer.