[mythtv-users] database access

backuppc at sundquist.imapmail.org backuppc at sundquist.imapmail.org
Thu Mar 5 04:24:05 UTC 2009


Ian wrote:

> > mrrooster wrote:
> >
> > > Or just omit the password and it will ask you for it on the command
> > line...
> > >
> > > ian[at]pvr:~$ mysql -u mythtv -p mythconverg
> > > Enter password:
> >
> > That worked for me and I got into the database.
> >
> [snip]
> 
> Does it work if you do:
> 
> mysql -u mythtv -p -h localhost mythconverg
> 
> ie, specify localhost on the command line. You could be connecting through a
> local unix socket by default?

That works, but so does the mrrooster's suggestion.

But though I can log in either way on the command line, I can't get
nuvexport and other scripts calling MythTV.pm to log into the database
to work.

Note, I have found the same problem with many other scripts that try to
log into the database, including optimize_mythdb.pl and even mythweb.

These are the lines of /usr/share/perl5/MythTV.pm where all these
scripts try to log into the database:

    # Connect to the database
        $self->{'dbh'} =
        DBI->connect("dbi:mysql:database=$self->{'db_name'}:host=$self->{'db_host'};port=$self->{'db_port'}",
                                      $self->{'db_user'},
                                      $self->{'db_pass'})
            or die "Cannot connect to database: $!\n\n";

I don't know perl at all.  Is there anyway I can get the perl module to
print out the variable values before it tries connecting so I can see
what it is using?

Well, actually, I guess don't need to, it tells me in the error message:

DBI
connect('database=mythconverg:host=localhost;port=3306','mythtv',...)
failed: Access denied for user 'mythtv'@'localhost' (using password:
YES) at /usr/share/perl5/MythTV.pm line 337
Cannot connect to database:

So it is trying to connect through "localhost"

What about the port number?  3306 is the standard port for mysql to
listen on, and it appears to be open:

user at mythtv:~$ netstat -na | grep 3306
tcp        0      0 127.0.0.1:3306          0.0.0.0:*              
LISTEN

This is driving me nuts and significantly cuts the value of my mythtv
system, although it still goes on great recording and playing back
shows.

Thanks.

Jon S.


More information about the mythtv-users mailing list