[mythtv-users] database connection just stopped working

R. G. Newbury newbury at mandamus.org
Tue Oct 18 14:01:49 UTC 2011

On 10/16/2011 11:16 PM, backuppc at sundquist.imapmail.org wrote:
> Hi all.  Used to lurk (and sometimes post) here lots back when first
> getting set up, but haven't been back for a while because it "just plain
> worked" (TM) and "if it ain't broke, don't fix it".
> I've gone through all the database troubleshoots, and it seems things
> work fine.  For example:
> user at mythtv:~$ mysql -u mythtv -p
> Enter password:
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 1035
> Server version: 5.1.41-3ubuntu12.10 (Ubuntu)
> Type 'help;' or '\h' for help. Type '\c' to clear the current input
> statement.
> mysql>


> 2011-10-16 22:19:38.140 Unable to connect to database!
> 2011-10-16 22:19:38.140 Driver error was [1/1045]:
> QMYSQL: Unable to connect
> Database error was:
> Access denied for user 'mythtv'@'localhost' (using password: YES)

That points exactly to the problem. You probably originally set things 
up with a hostname ("mythbox") and that has changed.
On a Fedora setup, the hostname is set in /etc/sysconfig/network. Check 
for the equivalent in your setup (I think the *buntu distros place it 
elsewhere). Fix to the proper hostname if in error.

If you use 'localhost' then you MUST have an /etc/hosts file with the localhost line.

I suggest that you make your /home/mythtv/.mythtv/mysql.txt file the 
'master' and make all of the *others* into symlinks to it.

While doing that, check that your /home/mythtv/.mythtv/config.xml file 
names the correct hostname.

Finally go into the mysql console as root (ie 'mysql -u root -p'), then 
'use mysql;' and
'select host,user,password from user;'

This will list the known user at host combinations known to mysql. Update 
as needed. If your setup is like mine, you will see host entries for 
localhost, the full hostname, and the actual IP address of the box. 
Properly, you only need to have the full hostname.

I suspect that your hostname setting went away, or the re-install 
removed the localhost line from your hosts file.


              R. Geoffrey Newbury			
            Barrister and Solicitor
       Suite 106, 150 Lakeshore Road West
          Mississauga, Ontario, L5H 3R2

         o905-271-9600 f905-271-1638
           newbury at mandamus.org

More information about the mythtv-users mailing list