DBI connect failed: Access denied for user 'mythtv'@'localhost'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mythexport (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi -
Mythexport (on mythbuntu 12.04) fails to connect to the mysql database, for some reason I cannot work out. The ~/.mythtv/
-------------
June 12 21:22:50 dan-mythbox /usr/bin/
DBI connect(
June 12 21:22:50 dan-mythbox /usr/bin/
at line 88 in /usr/bin/
June 12 21:22:50 dan-mythbox /usr/bin/
DBI connect(
June 12 21:22:55 dan-mythbox /usr/bin/
at line 88 in /usr/bin/
June 12 21:22:55 dan-mythbox /usr/bin/
--------------
I made a test script based on the mythexport code, as follows:
#!/usr/bin/perl
use strict;
use POSIX qw(setsid);
use DBI;
use DBD::mysql;
use Config::Simple;
use MythTV;
use Proc::Daemon;
use Proc::PID::File;
use Log::Dispatch;
use Log::Dispatch:
use Date::Format;
use File::Spec;
use File::Copy;
use XML::Writer;
use IO::File;
use lib '/usr/share/
use lib '/usr/share/
print "Dan's test script\n";
our $HOSTNAME = `hostname`;
chomp $HOSTNAME;
my $connect = undef;
my $myth = undef;
my $tries = 5;
while ($connect == undef && --$tries > 0) {
eval {
$myth = new MythTV();
# connect to database
$connect = $myth->{'dbh'};
1;
} or do {
sleep(5);
};
}
if ($connect == undef) {
die "Couldn't connect to MythTV.";
}
-------
This script has no problems connecting (it prints out "Dan's test script" and nothing else). So why does mythexport choke? It seems mysterious! Any tips please?
OK, here's the solution to this problem: the config file ~/.mythtv/ config. xml was NOT correct because it was in the wrong user's home directory. When I put it in the right place I got further.
So here's my request:
PLEASE POST MORE INFORMATIVE LOGGING INFORMATION!
(If the config file can't be found, the daemon should say so)
Thanks
Dan