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

Mike Perkins mikep at randomtraveller.org.uk
Mon Aug 20 20:04:42 UTC 2012


On 20/08/12 12:58, Joey Morris wrote:
> 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.
>
Yes, but that is to do with the content of the /login user's files/, not the 
value of the login user's name. Your system username can be anything, the 
database credentials anything else. The two are *not* connected, even in the 
slightest.

What you choose to store as text in files under any user is your affair.

-- 

Mike Perkins



More information about the mythtv-users mailing list