Mythtv won't install

Bug #41339 reported by Randy-Rhodas
36
Affects Status Importance Assigned to Milestone
mythtv (Ubuntu)
Fix Released
Medium
Mario Limonciello

Bug Description

When trying to install Mythtv I'll get the following error.

This is on a up to date Dapper system

randy-rhodas@smr:~$ sudo apt-get install mythtv
Password:
Reading package lists... Done
Building dependency tree... Done
mythtv is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 253 not upgraded.
2 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up mythtv-database (0.18.1-5ubuntu3) ...
Failed to connect to database: Access denied for user 'root'@'localhost' (using password: NO) at -e line 5, <> line 1.
Failed to create database (incorrect admin username/password?)
If you supplied incorrect information, try:
dpkg-reconfigure --force mythtv-database
dpkg: error processing mythtv-database (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mythtv:
 mythtv depends on mythtv-database (= 0.18.1-5ubuntu3); however:
  Package mythtv-database is not configured yet.
dpkg: error processing mythtv (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mythtv-database
 mythtv
E: Sub-process /usr/bin/dpkg returned an error code (1)
randy-rhodas@smr:~$

Revision history for this message
Randy-Rhodas (randy-rhodas) wrote :

If i try to run dpkg-reconfigure --force mythtv-database I'll get the following, after submitting "root" as the user name, an leaving the password field open.

randy-rhodas@smr:~$ sudo dpkg-reconfigure --force mythtv-database
Failed to connect to database: Access denied for user 'mysql'@'localhost' (using password: NO) at -e line 5, <> line 1.
Failed to create database (incorrect admin username/password?)
If you supplied incorrect information, try:
dpkg-reconfigure --force mythtv-database
randy-rhodas@smr:~$

Revision history for this message
stanwebber (stanwebber) wrote :

i ran into this exact same sequence. the problem occurs when mysql-server is installed as a dependancy of mythtv instead of being setup (with accounts & passwords) ahead of time. i fixed my install by assigning a mysql root password, reconfiguring mythtv-database to use that password & finally reinstalling mythtv:

mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('YourPasswordHere') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
dpkg-reconfigure --force mythtv-database
apt-get install mythtv

Changed in mythtv:
assignee: nobody → stanwebber
status: Unconfirmed → Rejected
stanwebber (stanwebber)
Changed in mythtv:
status: Rejected → Confirmed
Revision history for this message
Randy-Rhodas (randy-rhodas) wrote : RE: [Bug 41339] Re: Mythtv won't install

thank you for taking time to help me!!! I actualy struggeld so much that I
gave up:-(
I will try this as soon as my spare-time allows it:-)
again Thanks!!!
Hope it is ok, if i send you an E-mail if there should apear any other
problems.

best regards
john gunnar.

>From: stanwebber <email address hidden>
>Reply-To: Bug 41339 <email address hidden>
>To: <email address hidden>
>Subject: [Bug 41339] Re: Mythtv won't install
>Date: Wed, 09 Aug 2006 12:43:21 -0000
>
>** Changed in: mythtv (Ubuntu)
> Status: Rejected => Confirmed
>
>--
>Mythtv won't install
>https://launchpad.net/bugs/41339

_________________________________________________________________
MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million
låter

Revision history for this message
stanwebber (stanwebber) wrote :

this page should be of help to you:
http://www.abarbaccia.com/content/view/17/32/

i also just stumbled across this site which i haven't looked at closely yet
that you might want to check out, parker1.co.uk/mythtv_ubuntu.php

Randy-Rhodas writes:

> thank you for taking time to help me!!! I actualy struggeld so much that I
> gave up:-(
> I will try this as soon as my spare-time allows it:-)
> again Thanks!!!
> Hope it is ok, if i send you an E-mail if there should apear any other
> problems.
>
> best regards
> john gunnar.
>
>
>>From: stanwebber <email address hidden>
>>Reply-To: Bug 41339 <email address hidden>
>>To: <email address hidden>
>>Subject: [Bug 41339] Re: Mythtv won't install
>>Date: Wed, 09 Aug 2006 12:43:21 -0000
>>
>>** Changed in: mythtv (Ubuntu)
>> Status: Rejected => Confirmed
>>
>>--
>>Mythtv won't install
>>https://launchpad.net/bugs/41339
>
> _________________________________________________________________
> MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million
> låter
>
> --
> Mythtv won't install
> https://launchpad.net/bugs/41339

Revision history for this message
flaccid (chris-xhost) wrote :

The workaround suggested by stanwebber didn'g work for me.

Error is:

Failed to execute SQL: GRANT ALL PRIVILEGES ON .* TO @localhost IDENTIFIED BY 'zfcdascr'\nYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* TO @localhost IDENTIFIED BY 'zfcdascr'' at line 1 at -e line 8, <> line 1.

Why is the user zfcdascr coming from?

Anyway this is terrible and needs to be fixed by the package I assume.
I may create this user to see if I can work around the problem.

Revision history for this message
flaccid (chris-xhost) wrote :

Looking at the query anyway:

GRANT ALL PRIVILEGES ON .* TO @localhost IDENTIFIED BY 'zfcdascr';

Its obviously missing the database name and user params.
eg:

GRANT ALL PRIVILEGES ON db_name.* TO user@localhost IDENTIFIED BY 'zfcdascr';
or
GRANT ALL PRIVILEGES ON db_name.tbl_name TO user@localhost IDENTIFIED BY 'zfcdascr';

depending on required scope.

Pretty please fix this up or let me know a manual way to edit the script for now.

Revision history for this message
Mario Limonciello (superm1) wrote :

Your best bet at this point is to
sudo apt-get remove --purge mythtv-database
and reinstall it.
This should remove any settings that may be making a mockery of your setup.

Revision history for this message
flaccid (chris-xhost) wrote :

Mario, then you go back to the start again.

This is a bug.

Revision history for this message
Mario Limonciello (superm1) wrote :

Flaccid,
I can't exactly follow what the workaround posted above was doing since his site went down. Based on the fact that it is trying to get into the database by a random string of characters, I would bet those characters were the password generated for your mythtv user on the mysql database.

During the install of mythtv-database, the information that is used is the username and password stored in /etc/mythtv/mysql.txt. If you have since then changed the information used here in an attempt to resolve the database problem, that would be why you can't properly install mythtv-database.

At this point, sudo apt-get -f install or sudo dpkg-reconfigure mythtv-database should complete the install of mythtv-database. If there are permissions problems, the first thing to do is verify that /etc/mythtv/mysql.txt contains the correct information. If the database is already created and has data, edit this file to match the database name, user name, and password. If there are still issues here, and you can login to the database using the mysql command and your database username and password, then we have a problem here.
Contact me off this bug, and we will attempt to nail this before edgy release.

Revision history for this message
Wayne Schuller (k-wayne) wrote :

I hit this exact same problem. Today. Jan 6th 2006.

It seems you need to have mysql-server preinstalled and preconfigured and already know what your root password is.

Revision history for this message
flaccid (chris-xhost) wrote :

Wayne, I had mysql-server preinstalled, preconfigured and it doesn't make a difference.
Just wish the bug would get fixed.

Revision history for this message
Timothy Smith (tas50) wrote :

This bug still exists in MythTV today (3.26.07) in Beta 1+ updates. It's a real pain. There's a meta package to setup a complete mythtv backend that should make it simple for a user to configure but actually breaks their system because the mythtv-database package will not configure.

Problem: mysql-server is a dependency of mythtv-backend. When mythtv-backend is installed the mysql server is installed, but not configured with a password for the root user. Then mythtv-backend prompts the user for the root's password, but not properly distinguish between the root user's plain old password (which may / may not exist) and the mysql user's password. The user doesn't know what the mysql server password is so they enter their own password or something else and the package fails.

Solution: When mythtv-backend or similar meta packages trigger the installation of mysql they need to configure it. A password for the root user should be set and then mythtv-backend should be setup using this password. Otherwise this whole meta-package should go away because as it is the package just breaks systems until you remove mythtv-database or manually setup a password.

Revision history for this message
Wayne Schuller (k-wayne) wrote :

well the problem is that mysql has its own little world of usernames and passwords and privileges

there are security issues if applications can get mysql root access to easily

but i agree it is a bug and needs to be solved somehow, even if we simply provide instructions on how to set a mysql root password for that point of the installation

Revision history for this message
Timothy Smith (tas50) wrote :

I was able to change the the root password really simply with mysqladmin -u root -p password (this might be a tiny bit wrong). It just prompts for the new root password at this point. What keeps the package from prompting the user the enter the password using this same method?

Revision history for this message
Wayne Schuller (k-wayne) wrote :

yes that is how I did it also

the problem is if they are already using applications with mysql, they probably already have a root password set

but possibly it could assume there is no root password, set it, and then if that fails ask the user for the root password

mysql permissions are extremely capable but very complicated

Revision history for this message
Mario Limonciello (superm1) wrote :

Unfortunately there are repercussions in either assuming no root password
set, or having to ask for one.
A note though, the text does clearly point out: "Unless you have explicitly
changed the password on the MySQL server, leave this blank."

Wayne, I think you hit a possible solution right on the head though with
regard to trying with no password first and then asking only if need be.
I'll see what I can come up with the next few days that implements something
to this nature.

On 3/27/07, Wayne Schuller <email address hidden> wrote:
>
> yes that is how I did it also
>
> the problem is if they are already using applications with mysql, they
> probably already have a root password set
>
> but possibly it could assume there is no root password, set it, and then
> if that fails ask the user for the root password
>
> mysql permissions are extremely capable but very complicated
>
> --
> Mythtv won't install
> https://launchpad.net/bugs/41339
>

--
Mario Limonciello
<email address hidden>

Changed in mythtv:
assignee: stanwebber → superm1
Revision history for this message
Mario Limonciello (superm1) wrote :

The latest feisty packages now assume no root password during installation (as is the case for a brand new install of myth). This prevents any confusion for the user as to what password to enter. Now for anyone who HAS changed their root password, the package will install, but just require reconfiguration to setup that password.
sudo dpkg-reconfigure mythtv-database
will handle this

Changed in mythtv:
status: Confirmed → Fix Released
Revision history for this message
flaccid (chris-xhost) wrote :

Will the user be told they have to reconfigure if there is a root
password, or will they have to go searching around for help?
Can it just run dpkg-reconfigure mythv-database if there is a root pass?

On Thu, 12 Apr 2007 02:35:04 +1000, Mario Limonciello <email address hidden>
wrote:

> The latest feisty packages now assume no root password during
> installation (as is the case for a brand new install of myth). This
> prevents any confusion for the user as to what password to enter. Now
> for anyone who HAS changed their root password, the package will
> install, but just require reconfiguration to setup that password.
> sudo dpkg-reconfigure mythtv-database
> will handle this
>
> ** Changed in: mythtv (Ubuntu)
> Status: Confirmed => Fix Released
>

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Revision history for this message
Wayne Schuller (k-wayne) wrote :

this solution is good

for most users they will have no other mysql applications and have no root password set, it will just work.

for more advanced users they will have a root password and will have to figure it out what it is

this solution rewards the most common use case and puts the burden on advanced users to handle the more difficult case.

Revision history for this message
Mario Limonciello (superm1) wrote :

A warning should be popped up during installation if the mysql server is not
accessible during installation. The user will have to run dpkg-reconfigure
mythtv-database in this case. It doesn't automatically pop up because then
during upgrades users would receive errors about mysql passwords not working
(because mysql server is stopped during an upgrade) and are likely to
further muck up things by investigating wrong passwords.

On 4/11/07, flaccid <email address hidden> wrote:
>
> Will the user be told they have to reconfigure if there is a root
> password, or will they have to go searching around for help?
> Can it just run dpkg-reconfigure mythv-database if there is a root pass?
>
> On Thu, 12 Apr 2007 02:35:04 +1000, Mario Limonciello <email address hidden>
> wrote:
>
> > The latest feisty packages now assume no root password during
> > installation (as is the case for a brand new install of myth). This
> > prevents any confusion for the user as to what password to enter. Now
> > for anyone who HAS changed their root password, the package will
> > install, but just require reconfiguration to setup that password.
> > sudo dpkg-reconfigure mythtv-database
> > will handle this
> >
> > ** Changed in: mythtv (Ubuntu)
> > Status: Confirmed => Fix Released
> >
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>
> --
> Mythtv won't install
> https://bugs.launchpad.net/bugs/41339
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Mario Limonciello
<email address hidden>

Revision history for this message
stormreaver (kubuntu-tonyobryan) wrote :

I upgraded from Edgy to Feisty on Saturday, April 14, 2007 using update-manager (which worked very well until it encountered Myth), and ran into this problem on my previously functional MythTV setup. Now nothing will install via apt/adept without error messages. The most promising solution appeared to be, "sudo dpkg-reconfigure mythtv-database", but that presents its own problem. When running that command, I get an error message saying:

"/usr/sbin/dpkg-reconfigure: mythtv-database is broken or not fully installed"

Prior to running that command, I had tried uninstalling and reinstalling mythtv-database and mythtv. Removal went okay, but reinstallation caused the root password problem to reappear. Since my web site runs on Wordpress and therefore requires MySQL, I have a pre-existing non-default root password. The mythtv-database installer does not appear to try acquiring the MySQL root password in any form, and so gets stuck.

I am using 192.168.1.101 as the MySQL bind address since I want to allow my other networked MythTV front ends to connect to my server, and have allowed remote access to MySQL: grant all privileges on mythconverg.* to 'root'@'192.168.1.101' identified by '[my password]'; flush privileges;

mythtv-database attempts to connect to MySQL without a root password in any event.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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