[mythtv-users] Restore Database from Old Database Files -- No Backup

Ian Cameron mkbloke at gmail.com
Thu Jan 31 03:12:35 UTC 2019


On Thu, 31 Jan 2019 at 02:45, Stephen Worthington <stephen_agent at jsw.gen.nz>
wrote:

> You can just use a copy of those database files, as long as the
> version of MySQL or MariaDB is the same as when they were last being
> used in your old system.  Just copy the entire mythconverg directory.
> Check that the ownership of the files is correct after you copy the
> directory.  Since your new system is a clean install rather than an
> upgrade, the ID numbers assigned to the mysql and mysql group may be
> different from the old system.  So you may need to do a "chown -R
> mysql:mysql /var/lib/mysql/mythconverg" command to fix the ownership.
>

Just to add - copying the mythconverg files alone will require adding the
mythtv user again/granting privileges, as that data is stored in the main
mysql database tables, AFAIK.

The DB initialisation file at /usr/share/mythtv/sql/mc.sql on my 0.28
MythTV system does the following:

GRANT ALL ON mythconverg.* TO mythtv at localhost IDENTIFIED BY "password";
FLUSH PRIVILEGES;
GRANT CREATE TEMPORARY TABLES ON mythconverg.* TO mythtv at localhost
IDENTIFIED BY "password";
FLUSH PRIVILEGES;

You can run the above SQL statements from the command line using the mysql
client.  You can obtain the password for your old system from the MythTV
config.xml file and replace it in the statements above as necessary.

Cheers, Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20190131/0688363c/attachment.html>


More information about the mythtv-users mailing list