Mythweb - Database Access Denied error after updating

Bug #221532 reported by pdragon
10
Affects Status Importance Assigned to Milestone
Mythbuntu
Fix Released
High
laga

Bug Description

After doing an update with Update Manager to several mythtv packages (including mythweb), I could no longer access mythweb from a brower. It would give the following error:

"Database Access Denied
You are most likely receiving this message because you have failed to configure mythweb's database login info.
Please see INSTALL for instructions."

After speaking with Laga on the forums and IRC, I found a solution to my problem.

Look in /etc/mythtv/mysql.txt and note the password
Look in /etc/apache2/sites-available/mythweb.conf and note the password

Mine didn't match. I put the password from mysql.txt into mythweb.conf then reloaded apache and things worked again. Not sure how mythweb.conf got overwritten with a different database password.

Thread on support forums - http://ubuntuforums.org/showthread.php?t=764995

Revision history for this message
pdragon (pdragon) wrote :

Other person in the above thread confirmed this fixed it. Also had some other user come into IRC saying the same thing happened when they upgraded from 7.10 to 8.04. Still not sure what's causing it, but looks like it's not an isolated incident.

Revision history for this message
Paul (pgallant) wrote :

I installed a fresh copy of Mythbuntu 8.04. Everything went well - got everything working.
I then decided to enable password protection for Mythweb. Big mistake.

I used the control panel applet to enable password protection. Didn't work - I got an error. So I went back into the control panel and removed password protection.

Now I get an error:

Database Access Denied
You are most likely receiving this message because you have failed to configure mythweb's database login info.
Please see INSTALL for instructions.

I checked that my 2 config files have the same password. That's not the problem, it appears. I removed the MySQL password for user mythtv at host '%' but that didn't help. (I spotted a post that suggested this.) I ran the dpkg-reconfigure mythweb command too, but that didn't help.

Short of re-installing the whole thing, I don't know what else to try.
Any ideas? This really sucks because the system was all set and working perfectly.

Revision history for this message
Andrew Barton (barton101) wrote :

I have just installed Mythbuntu for the first time and get this message when I run Mythweb. I checked the two files and the passwords are different. Unless someone knows of a workaround, Mythweb is not working. Thanks in advance. Andrew

Revision history for this message
pdragon (pdragon) wrote :

Andrew:
Did you try the fix I mentioned? The passwords aren't supposed to be different.

Anyone figured out why this is happening yet? Looks to be confirmed.

Revision history for this message
laga (laga) wrote : Re: [Bug 221532] Re: Mythweb - Database Access Denied error after updating

pdragon schrieb:
> Andrew:
> Did you try the fix I mentioned? The passwords aren't supposed to be different.
>
> Anyone figured out why this is happening yet? Looks to be confirmed.
>
>
I'll look into it as soon as I can find some spare time

Revision history for this message
Andrew Barton (barton101) wrote :

Hi guys,

I can confirm that this is still a problem.

1) I have a fresh install of Mythbuntu (first time user - just come from GBPVR)
2) I get the "Database Access Denied" message as above.
3) The passwords in the two files were different.
4) I changed the mythweb.conf password to match to other password and Mythweb worked. :)
5) I then went back to the Config utility to change the mythweb password and this created the error again in that the two passwords differed.
6) I made the passwords the same again and all is well.

Hope this helps, but this is a confirmed problem.

Regards Andrew

Revision history for this message
Douglas Wagner (douglasw0) wrote :

FYI It's not JUST the password that this has problems with.

On my setup I use a full machine name for the installation instead of "localhost": xxx.yyy.org

I confirmed the password mismatch but MythWeb still wouldn't connect, kept returning the Database Mismatch problem.

The end result is that upon installation MythBuntu only sets up the password for the host you tell it to, not BOTH the full machine name and localhost (this is a shared Frontend/Backend btw). Thus mythtv@localhost has a different password for me (unknown and undefined) than does <email address hidden>.

Make sure the DBHostName in /etc/mythtv/mysql.txt also matches the db_server in /etc/apache2/sites-available/mythweb.conf

So, to get this setup correctly you want to match up the following two:

/etc/mythtv/mysql.txt: DBHostName -> /etc/apache2/sites-available/mythweb.conf: db_server
/etc/mysql/mysql.txt: DBpassword -> /etc/apache2/sites-available/mythweb.conf: db_password

--Doug

Revision history for this message
Aaron Whitehouse (aaron-whitehouse) wrote :

Confirmed. I also installed a fresh Mythbuntu 8.04 install and thought I had set up everything correctly through the GUI. Mythweb gave me the above error and I remedied it by copy and pasting the password from mysql.txt.

Changed in mythbuntu:
status: New → Confirmed
Revision history for this message
ninti (nintigod) wrote :

I too had this problem, with a new install, by using the control center to set up a new password for mythweb. And I can fix the database error by copying the password from mysql.txt into mythweb.conf. But it doesn't work the other way; copying the password from mythweb.conf and putting it in mysql.txt fails. And unfortunately the mysql.txt password is gibberish and I don't feel like remebering it.

So I did the following:

Log into mysql as root:

                 mysql -u root

Inside of mysql, change the mysql password for the mythtv user to be my new password:

                  UPDATE user SET Password=PASSWORD('MyNewPassword') WHERE User='mythtv'; FLUSH PRIVILEGES; exit;

Go back and change the password in both /etc/apache2/sites-available/mythweb.conf:

                 setenv db_password "MyNewPassword"

as well as /etc/mythtv/mysql.txt:

                 DBPassword=MyNewPassword

Then restart Apache:

                 sudo apache2ctl -k restart

And that appears to work.

laga (laga)
Changed in mythbuntu:
assignee: nobody → laga
importance: Undecided → High
milestone: none → 8.10-final
Revision history for this message
MarcRandolph (mrand) wrote :

Howdy, does anyone know if this was fixed in 8.10 (or 9.04)?

Revision history for this message
Jeff Sereno (jsereno) wrote :

I suspect this isn't fixed because I'm using Ubuntu Jaunty 9.04 with Myth on top on a dedicated backend server, did some updates last night and all of a sudden today MythWeb is saying "database access denied". Upon checking the Apache configuration file for MythWeb as suggested, sure enough - the password has been changed to something else! After modifying it back to what it should be and restarting Apache, MythWeb worked again.

The scary thing is that I do not recall having downloaded any recent updates to do with MythTV in general!

Revision history for this message
MarcRandolph (mrand) wrote :

Removing 8.10 milestone since there is a report of it still occurring.

Changed in mythbuntu:
milestone: 8.10-final → none
Revision history for this message
Nick Fox (nickj-fox) wrote :

mythplugins (0.21.0+fixes19556-0ubuntu2) jaunty; urgency=low

  * debian/mythweb.postinst:
    - Clear mythtv password when we're done
    - Use sed -i rather than sed and mv.
  * debian/mythweb.config:
    - Prefill all data from /etc/mythtv/mysql.txt
      it should be the preferred method.

 -- Mario Limonciello <email address hidden> Sat, 17 Jan 2009 13:50:31 -0600

Changed in mythbuntu:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.