[mythtv-users] database access

Owen Townend owen.townend at gmail.com
Fri Mar 6 04:28:34 UTC 2009


2009/3/6  <backuppc at sundquist.imapmail.org>:
> Well, I got it to work, but what I did I shouldn't have to do, is a
> kludge, and/or is a security risk.
>
> I poured over /usr/share/perl5/MythTV.pm
>
> and found these lines:
>
> # Read the mysql.txt file in use by MythTV.  It could be in a couple
> places,
> # so try the usual suspects in the same order that mythtv does in
> # libs/libmyth/mythcontext.cpp
>    our %mysql_conf = ('hostname' => hostname,
>                       'db_host'  => 'localhost',
>                       'db_port'  => '',
>                       'db_user'  => 'mythtv',
>                       'db_pass'  => 'mythtv',
>                       'db_name'  => 'mythconverg',
>                       'upnp_pin' => '',
>                      );
>
> -----------------
>
> This is around line 255.  This line seems to be setting the db_pass to
> 'mythtv' which isn't the password.  I've never edited this file, so why
> is this in here?  I don't know perl, but it seems like it is looking for
> mysql.txt config file like it is supposed to, but doesn't use the
> password in that file, but rather the one from this line in the perl
> module.
>
> So I just edited in the actual password, and now nuvexport,
> optimize_mythdb.pl and other scripts calling MythTV.pm work.  But this
> is just a kludge at best.
>
> Note:
>
> user at mythtv:~$ ls -la `locate mysql.txt`
> -rw-r--r-- 1 root     root     78 2008-10-04 20:05 /etc/mythtv/mysql.txt
> lrwxrwxrwx 1 user user 21 2008-12-30 17:28 /home/user/.mythtv/mysql.txt
> -> /etc/mythtv/mysql.txt
> lrwxrwxrwx 1 mythtv   root     21 2008-10-04 20:05
> /home/mythtv/.mythtv/mysql.txt -> /etc/mythtv/mysql.txt
> lrwxrwxrwx 1 root     root     21 2008-10-04 19:53
> /usr/share/mythtv/mysql.txt -> /etc/mythtv/mysql.txt
>
> so I have the config files in the correct/usual spots so they should be
> found, right?
>
> Any reason why the config file can't be found.  If it is found and not
> used, that would be a bug in MythTV.pm, but nobody else has that problem
> ?!
>
[snip]

Looking at the script, it's not searching for mysql.txt, it's looking for
config.xml which is usually in /home/mythtv/.mythtv/config.xml

It sets defaults up where you specified, then tries to override them
from the config file, then from the commandline ops.

Does your config.xml show the same settings as your mysql.txt?

cheers,
Owen.


More information about the mythtv-users mailing list