[mythtv-users] DB Backup Issues

Chuck Peters cp at ccil.org
Mon Apr 23 10:22:11 UTC 2012


I was about to upgrade my Ubuntu 10.04 Mythtv backend to .25 and manually 
running the mythconverg_backup.pl isn't working. The script says access 
denied, but I haven't changed the password and everything else appears to 
be working.  The frontends all work, and I had an old file saved from 
2009-03-19 that shows the same mythconverg_backup.pl --verbose command 
working.  If I run the backup via mysqldump without the username and host 
parameters it seems to work fine.  I am running a bind server with a lan 
zone and the error message shows the hostname io.lan rather than the IP, 
could this be the cause?

I would like to get this cleared up before I upgrade the Mythtv. Any 
suggestions?
 

One thing that is really odd is every Wednesday somehow mythconverg is getting 
backed up. It isn't a standard cron job, how is it doing it?

root at io:/home/mythtv# ls -l mythconverg*
total 51632
-rw-r--r-- 1 root root 10744029 2012-03-21 10:02 mythconverg-1264-20120321100221.sql.gz
-rw-r--r-- 1 root root 10407989 2012-03-28 10:04 mythconverg-1264-20120328100446.sql.gz
-rw-r--r-- 1 root root 10590377 2012-04-04 08:18 mythconverg-1264-20120404081822.sql.gz
-rw-r--r-- 1 root root 10417111 2012-04-11 04:28 mythconverg-1264-20120411042838.sql.gz
-rw-r--r-- 1 root root 10616640 2012-04-18 10:14 mythconverg-1264-20120418101352.sql.gz


root at io:~# mythconverg_backup.pl --verbose

Configuring environment:
  -    username: root
  -        HOME: /root
  - MYTHCONFDIR: /root/.mythtv

Parsing configuration files:
  - checking: /root/.mythtv/config.xml
     parsing: /root/.mythtv/config.xml
  - checking: /root/.mythtv/backuprc
     parsing: /root/.mythtv/backuprc

Applying command-line arguments.

Checking configuration.

No DBSchemaVer specified, querying database.
Found DBSchemaVer: 1264.

Database Information:
         DBHostName: 192.168.2.3
             DBPort: 0
         DBUserName: mythtv
         DBPassword: XXX
             DBName: mythconverg
        DBSchemaVer: 1264
  DBBackupDirectory: /home/mythtv
   DBBackupFilename: mythconverg-1264-20120423060244.sql

Executables:
          mysqldump: mysqldump
           compress: gzip

Attempting to use supplied password for mysqldump.
Any [client] or [mysqldump] password specified in the MySQL options file will
take precedence.

Executing command:
'/usr/bin/mysqldump' --defaults-extra-file='/tmp/8N6Wx4BmxY' --host='192.168.2.3' --user='mythtv' --add-drop-table --add-locks --allow-keywords --complete-insert --extended-insert --lock-tables --no-create-db --quick --add-drop-table 'mythconverg' 2>&1 1>'/home/mythtv/mythconverg-1264-20120423060244.sql'

mysqldump exited with status: 2
mysqldump output:
mysqldump: Got error: 1045: Access denied for user 'mythtv'@'io.lan' (using password: YES) when trying to connect


root at io:~# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 887
Server version: 5.1.62-0ubuntu0.10.04.1 (Ubuntu)

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select host,user,password from user;
+-----------+------------------+-------------------------------------------+
| host      | user             | password                                  |
+-----------+------------------+-------------------------------------------+
| localhost | root             | *aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
| 127.0.0.1 | root             | *aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
| localhost |                  |                                           |
| localhost | debian-sys-maint | *yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy |
| localhost | mythtv           | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| %         | mythtv           | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
+-----------+------------------+-------------------------------------------+
6 rows in set (0.00 sec)

I have an old nightly cron job doing a db backup and it seems to work:
root at io:~# cat /usr/local/sbin/backup-prep.sh 
#!/bin/sh

# This list is useful to restore packages, ie cat /etc/dpkg--get-selections | dpkg --set-selections
# and run apt-get install dselect or whatever.
dpkg --get-selections > /var/backups/dpkg--get-selections

dpkg-query --show > /var/backups/dpkg-query--show

set -e -u

DBNAME="mythconverg"
BACKUP="/var/backups/mysql/$DBNAME.sql.gz"
DEBIAN="--defaults-extra-file=/etc/mysql/debian.cnf"
OPTIONS="--all --complete-insert --extended-insert --quick --quote-names --lock-tables"

/usr/bin/mysqldump $DEBIAN $OPTIONS $DBNAME | gzip > $BACKUP


Thanks,
Chuck


More information about the mythtv-users mailing list