Recovering from running out of space on / and losing MySQL connection information in Mythbackend

Asked by Aaron Whitehouse

This problem was solved for me by the NZ MythTV list. Thanks all, I thought I should put the solution on here to help others.

I just tried to archive a recording on my Mythbuntu setup. The recording
was bigger than a DVD, so I canceled it. Then things started to go
funky with the Media Library showing no recordings and the Upcoming
Recordings missing. I restarted and MythTV couldn't connect to the database.

If I typed:
$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)

And the /var/run/mysqld directory doesn't seem to exist.

mythbuntu@mythbuntu-server:/var/run$ ls mysql*
ls: cannot access mysql*: No such file or directory

I tried to reinstall mysql-server through synaptic, but got an error
about a subprocess that made me realise that the problem was MythArchive
leaving me with no free space on the root partition.

I have now cleared the space and MySQL seems to be much happier (starts
and mysqldump gives a sensibly-sized file). Unfortunately, I seem to
have broken MythTV's connection to the database in my fiddling. I assume
that I somehow need to change it so that it knows where to find the
MySQL installation and the name/pass of the database.

I have tried renaming the ~/mythtv/ folder, which I thought was where
the backend files were (as distinct from ~/mythbuntu/, where I thought
the frontend files were), but that didn't reset anything or make
anything ask me for the database details. If I run mythtv-setup, it
prompts me to close running processes, then asks me to run
mythfilldatabase, without doing anything in between.

Question information

Language:
English Edit question
Status:
Solved
For:
Mythbuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Aaron Whitehouse
Solved:
Last query:
Last reply:
Revision history for this message
Aaron Whitehouse (aaron-whitehouse) said :
#1

Simon Cantem wrote:

The config files for the backend are stored in /etc/mythtv - the most important file there is mysql.txt which will contains the database settings. You might want to connect to the database with those settings to make sure the username and password still work, or as root run "mysql" then "show databases;" to make sure the mythconverg database is still there.

The other thing to try is give the backend a kick (run: /etc/init.d/mythbackend restart) and then have a look at the end of the file /var/log/mythtv/mythbackend.log to see if there's any errors.

Mark Van Dijk wrote:

Hi Aaron, coincidentally i just had a similar thing thing happen to me a
couple of days ago. I filled up my root partition, which prevented mysql
from starting, and then somehow prevented myth frontend/backend from seeing
the database when it did come back up.

To fix it, here's what i did:
1) clear out the root partition
2) use the 'df' and 'du' commands to verify the root partition
   had plenty of space
3) rebooted, then made sure that i could access mysql via a
   command line
4) for MythTv to connect to mysql, it needs some info. For
   Mythbuntu 8.04 (at least) this is:
      host (usually 'localhost')
      database (usually 'mythconverg')
      username (usually 'mythtv')
      password ( ????? - no idea what this is supposed to be )

   I didn't know what password i should be using, so using the
   mysql command line tools i did:
        update user set password=PASSWORD('mythtv') where username='mythtv'
5) reboot (don't think that was actually necessary, but thats
   what i did)
6) run 'mythtv-setup' from the command line and entered the
   details from step 4). This should modify the /etc/mythtv/mysql.txt
   file with the correct information
7) At this point, i could start Myth Frontend manually. Did another
reboot.
8) that was it! everything burst into life after that.

Revision history for this message
Aaron Whitehouse (aaron-whitehouse) said :
#2

I've fixed the settings in mysql.txt and everything
is working as usual (before tonight's programmes, too)! I didn't know
what the database type should be, but I just left it blank and the
backend, main frontend and the network frontend that I tested all work
as expected.