mythtv-database configuration cannot connect to MySQL database

Bug #109950 reported by stormreaver
6
Affects Status Importance Assigned to Milestone
mythtv (Ubuntu)
Fix Released
Undecided
Mario Limonciello

Bug Description

Binary package hint: mythtv-database

I upgraded from Kubuntu Edgy to Feisty 7.04 using update-manager. Now apt-get (and anything that uses it, such as Adept) always reports an error with mythtv-database. The mythtv-database configuration always tries to connect to MySQL as the root user, but without a password. Since my MythTV setup existed prior to updating and my MySQL database already has a password assigned to the root user for use by Wordpress, the attempted connection to MySQL as a passwordless root user fails. I have correct mythtv login credentials for the mythtv user in /etc/mythtv/mysql.txt, but they appear to be ignored.

Ralph Janke (txwikinger)
Changed in mythtv:
assignee: nobody → rjanke
Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 109950] mythtv-database configuration cannot connect to MySQL database

At this point, you should be able to follow the popup's directions and

sudo dpkg-reconfigure mythtv-database

To enter the root password that you currently have assigned.

Can you attempt that?

Ralph Janke (txwikinger)
Changed in mythtv:
assignee: rjanke → nobody
Revision history for this message
stormreaver (kubuntu-tonyobryan) wrote :

This is the result of running sudo dpkg-reconfigure mythtv-database:

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

I have already tried uninstalling and then reinstalling mythtv-database and mythtv, but that didn't help anything. MythTV is working, but I can't install anything without triggering the error messages. Installing other software packages is successful, so this problem isn't preventing installation of anything. It's just annoying.

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 109950] Re: mythtv-database configuration cannot connect to MySQL database

When removing mythtv-database, have you purged?

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

I'll try purging when I get home from work. Will that affect any of my recordings (I'm new to Kubuntu and Debian-based packaging)?

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

All of the recordings will still remain, and the mysql table should still be
there as well. I'm mentioning to backup the mysql table *just in case*
something happens to go wrong. In the event that it does, its a very easy
restoration process. Recordings wont' be touched in any case here.

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

Still no luck. I stopped the MythTV back end, removed mythtv and mythtv-database with, "sudo apt-get --purge remove mythtv-database", and got:

Removing mythtv ...
Removing mythtv-database ...
Purging configuration files for mythtv-database ...

I then typed: "sudo apt-get install mythtv-database" and got:

Setting up mythtv-database (0.20-svn20070122-0.0ubuntu6) ...
Failed to connect to database: Access denied for user 'root'@'192.168.1.101' (using password: NO) at -e line 5, <> line 1.
Failed to create database (incorrect admin username/password?)
It's also possible that mysql-server wasn't running. After install
is completed, you will need to make sure mysql-server is running
and that you supplied correct information. Try:
sudo dpkg-reconfigure mythtv-database
cp: cannot create regular file `/var/lib/update-notifier/user.d/mythtv-reconfigure-required': No such file or directory
dpkg: error processing mythtv-database (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mythtv-database
E: Sub-process /usr/bin/dpkg returned an error code (1)

I then tried reconfiguring, and got nowhere.

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

Ok,
Check out /var/lib/update-notifier/user.d

Does this directory exist? Do a 'ls -l' in it. Do you have a broken file in there (due to corruption?) Thats exactly what this is sounding like. Or possibly somehow your permissions on /var/lib/update-notifier/user.d gut fizzled.

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

I have a /var/lib/update-manager directory (which is empty), but no /var/lib/update-notifier directory at all. With the quantity of error messages, I didn't even notice the "No such file or directory" error message until now. Can I just create this directory by hand, or do I need to run a configuration program to make sure things are done right?

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 109950] mythtv-database configuration cannot connect to MySQL database

ah. may have found the source of this bug now. make the directory in
question and reinstall the package. ill do some experiments to
determine what situation caused this to happen.

On 4/28/07, stormreaver <email address hidden> wrote:
> I have a /var/lib/update-manager directory (which is empty), but no
> /var/lib/update-notifier directory at all. With the quantity of error
> messages, I didn't even notice the "No such file or directory" error
> message until now. Can I just create this directory by hand, or do I
> need to run a configuration program to make sure things are done right?
>
> --
> mythtv-database configuration cannot connect to MySQL database
> https://bugs.launchpad.net/bugs/109950
> You received this bug notification because you are a member of MythTV
> Ubuntu Maintainers, which is a bug contact for mythtv in ubuntu.
>

--
Mario Limonciello
<email address hidden>

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

Okay. Indeed - the issue is that update-notifier needs to be installed. The
package fails elsewise. I'll add this to the packaging. For now, install
update-notifier manually followed by mythtv-database. Update-notifier
creates that directory.

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

I installed update-notifier and tried to reconfigure mythtv-database and mythtv with "sudo dpkg --configure -a", and saw nothing. I then tried "sudo dpkg --configure mythtv-database", and was told that mythtv-database was already fully configured (yay!). I updated the 21 packages that adept_notifier had flagged since just after this began, and everything went smoothly.

Thank you for your help. Everything works again.

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 109950] Re: mythtv-database configuration cannot connect to MySQL database

This has been fixed in bzr (added update-notifier to the depends for
mythtv-database)

On 4/28/07, stormreaver <email address hidden> wrote:
>
> I installed update-notifier and tried to reconfigure mythtv-database and
> mythtv with "sudo dpkg --configure -a", and saw nothing. I then tried
> "sudo dpkg --configure mythtv-database", and was told that mythtv-
> database was already fully configured (yay!). I updated the 21 packages
> that adept_notifier had flagged since just after this began, and
> everything went smoothly.
>
> Thank you for your help. Everything works again.
>
> --
> mythtv-database configuration cannot connect to MySQL database
> https://bugs.launchpad.net/bugs/109950
> You received this bug notification because you are a member of MythTV
> Ubuntu Maintainers, which is a bug contact for mythtv in ubuntu.
>

--
Mario Limonciello
<email address hidden>

Changed in mythtv:
status: Unconfirmed → In Progress
Revision history for this message
David Morris (dave-greenacre) wrote :

superm1 is this fixed yet and if so can you close it

Changed in mythtv:
assignee: nobody → superm1
Changed in mythtv:
status: In Progress → Fix Committed
Changed in mythtv:
status: Fix Committed → Fix Released
Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

No! Please! Let's not pollute mythtv-database with "desktop" type dependencies!

Why do I have to install all of this crap:

  dbus dbus-1-utils gamin gnome-mime-data hal launchpad-integration
  libaspell15 libavahi-client3 libavahi-common-data libavahi-common3
  libavahi-glib1 libbonobo2-0 libbonobo2-common libbonoboui2-0
  libbonoboui2-common libenchant1c2a libgamin0 libgnome2-0 libgnome2-common
  libgnomeui-0 libgnomeui-common libgnomevfs2-0 libgnomevfs2-common
  libhal-storage1 libhal1 liblaunchpad-integration0 libsexy2 libvte-common
  libvte9 libwnck-common libwnck18 libxres1 mythtv-backend-master
  mythtv-database notification-daemon python-apt python-cairo python-central
  python-dbus python-gconf python-glade2 python-gnupginterface python-gobject
  python-gtk2 python-numeric python-pyorbit python-support python-vte
  shared-mime-info synaptic update-manager update-manager-core update-notifier

on my mythbackend?

This cannot be the right way to fix whatever problem is being described in this bug.

Revision history for this message
Timothy Legge (timlegge) wrote :

This seems to be related to the bind-address in /etc/mysql/my.cnf. I had changed mine to my ip address so the other front ends could access the database. It seems that root is somehow prevented from logging in when the ip address is different.

I replaced the bind-address with 127.0.0.1 and sudo dpkg-reconfigure mythtv-database worked fine (well, no output so I assume it worked.)

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.