[mythtv-users] Problem Connecting To Database

Tom Purl tom at tompurl.com
Sun Nov 12 19:32:23 UTC 2006


>>On 11/12/06, Tom Purl <[1]tom at tompurl.com> wrote:
>> 
>>  Hi, I used to run a mythtv 0.20 system on Ubuntu, but I recently
>>  switched to Gentoo.  After setting everything up and installing
>>  mythtv, I ran the following command to restore my old DB:
>>
>>      mysql -u root -h localhost < /home/foo/backups/mythdb_061102.bak
>> 
>>  I then added the 'mythtv' user to mysql (5.0.26-log) by using the
>>  following command from the mysql prompt:
>> 
>>      grant all on mythdb.* to 'mythtv'@'localhost' identified by
>>      'somepass';
>> 
>>  I can then log into mysql as the mythtv user and create a test table,
>>  proving that I have the proper security access.
>> 
>>  I also have a mysql.txt file in the following directories:
>> 
>>      -rwxr----- 1 mythtv root 957 Nov 12 08:28 /etc/mythtv/mysql.txt
>>      -rwxrw---- 1 foo    foo  957 Sep 23 09:09 /home/foo/.mythtv/mysql.txt
>> 
>>  In tha tfile, I have the following text:
>> 
>>      DBHostName=localhost
>>      DBUserName=mythtv
>>      DBPassword=somepass
>>      DBName=mythdb
>>      DBType=QMYSQL3
>> 
>>  Here's my problem:  when I try and start mythbackend
>>  (sudo /etc/init.d/mythbackend start) , I get the following error
>>  messasge
>>  in /var/log/mythtv/mythbackend.log:
>> 
>>      QSqlQuery::exec: database not open
>>      QSqlQuery::exec: database not open
>> 
>>  mysql is running, so I don't understand why I'm getting this error.
>>  Can anyone else see why this may be happening?
>> 
>>  Thanks a ton in advance!
>> 
>>  Tom Purl

> So you can "mysql -u mythtv -p mythconverg"?

Yes, except the name of my database is mythdb.  Also, in
mythtv-setup, I use 127.0.0.1 instead of localhost, so I logged into
mysql using the following command:

    mysql -u mythtv -h 127.0.0.1 -p mythdb

...and it worked.  
  
> Try using your real IP address instead of localhost. Something along
> the lines of [2]192.168.1.2. Use that in mythtv-setup instead of
> localhost.

Since I'm using the 127.0.0.1 ip address, and tested it with the
mysql client, I didn't try this workaround.

What else could I be missing?

Thanks again!

Tom Purl


More information about the mythtv-users mailing list