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

Forum for questions and support relating to the 1.30.x releases only.
Locked
davidsmoot
Posts: 15
Joined: Tue Feb 26, 2013 2:35 am

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

Post 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
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

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

Post by SteveGilvarry »

Actual upgrade guides in case you missed something https://wiki.zoneminder.com/Common_Issu ... u#Upgrades
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
davidsmoot
Posts: 15
Joined: Tue Feb 26, 2013 2:35 am

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

Post 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?
bbunge
Posts: 2944
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

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

Post 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.
davidsmoot
Posts: 15
Joined: Tue Feb 26, 2013 2:35 am

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

Post 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.
Locked