Not sure what I should do, I have Ubuntu 22.04.4 running Zoneminder v1.36.33 and when I ran 'sudo apt full-upgrade' it threw the errors below.
After the failed update, the console showed Zoneminder was Stopped, but it started and seems to run fine, and the version now shows v1.36.34.
In the error, it says '-hlocalhost zm" but zm is not the hostname. Should I stop zoneminder and attempt the solutions listed in errors? Not sure how...
Setting up zoneminder (1.36.34-jammy1) ...
detected systemd
Detected db service is mariadb.service
Checking for db
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Cannot talk to database. You will have to create the db manually with something like:
cat /usr/share/zoneminder/db/zm_create.sql | mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
/var/lib/dpkg/info/zoneminder.postinst: 29: [: -ne: unexpected operator
Updating permissions for user zmuser@localhost
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Initiating database upgrade to version 1.36.34 from version 1.36.33
Upgrading database to version 1.36.34
Upgrading DB to 1.36.34 from 1.36.33
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Output:
Command 'mysql --defaults-file=/etc/mysql/debian.cnf -hlocalhost zm < /usr/share/zoneminder/db/zm_update-1.36.34.sql' exited with status: 1
Error updating db.
dpkg: error processing package zoneminder (--configure):
installed zoneminder package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)
using apt to upgrade throws error..
Re: using apt to upgrade throws error..
In debian based distros, they put a file in /etc/mysql/debian.cnf with authentication settings so that root can do things in a secure way without requiring typing in a password. Hence the --defaults-file=/etc/mysql/debian.cnf in the command lines.
Someone/something has damaged this setup.
You can test by doing:
sudo mysql --defaults-file=/etc/mysql/debian.cnf
It should let you right in. Does debian.cnf exist? Has it been altered? This is where you will need to investigate.
Someone/something has damaged this setup.
You can test by doing:
sudo mysql --defaults-file=/etc/mysql/debian.cnf
It should let you right in. Does debian.cnf exist? Has it been altered? This is where you will need to investigate.
Re: using apt to upgrade throws error..
debian.cnf does exist and seems to be the original, but as suggested online I added password lines to the file:
password = "mysupersecretpass"
Now apt finishes the upgrade.
password = "mysupersecretpass"
Now apt finishes the upgrade.