<div dir="ltr">On my test mythtv backend I'm trying to set up to use ntfy.sh. I seem to have a permissions issue that I'm not able to fix.<div><br></div><div>I set up my database using the following mysql instructions:</div><div><br></div><div>mythtv_password=mythtv <br></div><div>sudo mysql -uroot << ENDOFSCRIPTINPUT<br>CREATE DATABASE IF NOT EXISTS mythconverg;<br>CREATE USER IF NOT EXISTS 'mythtv'@'%' IDENTIFIED BY 'mythtv';<br>CREATE USER IF NOT EXISTS 'mythtv'@'localhost' IDENTIFIED BY 'mythtv';<br>SET PASSWORD FOR 'mythtv'@'%' = PASSWORD('$mythtv_password');<br>SET PASSWORD FOR 'mythtv'@'localhost' = PASSWORD('$mythtv_password');<br>CONNECT mythconverg;<br>GRANT ALL PRIVILEGES ON *.* TO 'mythtv'@'%' WITH GRANT OPTION;<br>GRANT ALL PRIVILEGES ON *.* TO 'mythtv'@'localhost' WITH GRANT OPTION;<br>FLUSH PRIVILEGES;<br>EXIT<br>ENDOFSCRIPTINPUT<br></div><div><br></div><div>This works for using mythtv backend and frontend. However, when running my backup script I see:</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">[mythtv@nucboxg3 ~]$ mythtv-database-backup.sh  </span><br>/usr/bin/mariadb-check: Got error: 1045: Access denied for user 'mythtv'@'localhost' (using password: NO) when trying to connect<br>
<br></span></div><div><span style="font-family:monospace">This is the script that I can either run as user mythtv normally or in a systemd service with a timer. When run by systemd everything works except for the mariadb-check so until I checked the logs I didn't know it wasn't working because I was getting the backups and notifications.</span></div><div><span style="font-family:monospace"> </span></div><div>#!/bin/sh<br># /etc/cron.weekly/mythtv-database script - check and backup mythconverg tables<br># Copyright 2005/12/02 2006/10/08 Paul Andreassen<br>#                      2010 Mario Limonciello<br>set -e -u<br>DBNAME="mythconverg"<br>USER=mythtv<br>BKUP_LOG=/tmp/backup-mythconverg.log<br>export MYTHCONFDIR=/home/$USER/.mythtv/<br>/usr/bin/mariadb-check -s $DBNAME<br>/usr/local/bin/<a href="http://optimize_mythdb.pl">optimize_mythdb.pl</a> | grep -v "^Analyzed:" 2>&1 >> $BKUP_LOG<br>sudo --preserve-env --user=$USER /usr/share/mythtv/<a href="http://mythconverg_backup.pl">mythconverg_backup.pl</a> --rotate=5 --verbose 2>&1 >> $BKUP_LOG<br>if [ $? -eq 0 ]; then<br>    MSG="nucboxg3 $DBNAME Checked and Backed Up, RC=$?"<br>else<br>    MSG="nucboxg3 $DBNAME Back Up Failed, RC=$?"<br>fi<br>cd /mythtv/db_backups<br>ls -l --directory --block-size=K * | tail -10 >> $BKUP_LOG<br>bash <(curl -d "$MSG" <a href="http://ntfy.sh/jfa-mythtv-database-backup">ntfy.sh/jfa-mythtv-database-backup</a>)<br></div><div><br></div><div>What am I missing?</div><div><br></div><div>Jim A</div><div><br></div></div>