[mythtv-users] running mythconverg_backup.pl as non-mythtv user

Joey Morris rjmorris at nc.rr.com
Mon Aug 20 11:58:29 UTC 2012


Mike Perkins <mikep at randomtraveller.org.uk> wrote on Mon, Aug 20, 2012 at 09:51:15AM +0100:
> On 19/08/12 17:11, Joey Morris wrote:
> >I tried to run mythconverg_backup.pl on a 0.24 database as a user
> >other than my mythtv user. I also run mythfrontend as that user, so
> >the user has the appropriate mythconverg username/password defined in
> >the files under the ~/.mythtv directory. When I ran the backup script,
> >it failed with the message:
> >
> >   mysqldump: Got error: 1045: Access denied for user
> >   'mythtv'@'localhost' (using password: YES) when trying to connect
> >
> Confusion here? The 'database user' mysql requires credentials for
> has *nothing* to do with the 'login user' who runs the script.

There is a connection, actually. mysqldump looks for MySQL options in
the following files, with options found in later files taking
precedence:

/etc/my.cnf
/etc/mysql/my.cnf
$SYSCONFDIR/my.cnf
$MYSQL_HOME/my.cnf
value of --defaults-extra-file command line option
~/.my.cnf

[http://dev.mysql.com/doc/refman/5.5/en/option-files.html]

mythconverg_backup.pl takes the password out of ~/.mythtv/config.xml
and passes it to mysqldump via the --defaults-extra-file option.
However, if the login user has a password in ~/.my.cnf, mysqldump uses
that password instead. That's what was happening in my case, so
mysqldump tried to log in as the database user but with the login
user's password.


More information about the mythtv-users mailing list