[mythtv-users] db restore
Stephen Worthington
stephen_agent at jsw.gen.nz
Tue Aug 7 02:54:26 UTC 2018
On Mon, 6 Aug 2018 16:28:15 -0400, you wrote:
> mysql> GRANT ALL PRIVILEGES ON *.* TO 'mythtv'@'localhost' IDENTIFIED BY
>'mythtv' WITH GRANT OPTION;
>Query OK, 0 rows affected, 1 warning (0.01 sec)
>
>mysql> SET PASSWORD for 'mythtv' = PASSWORD('********');
>Query OK, 0 rows affected, 1 warning (0.00 sec)
>
>mysql> FLUSH PRIVILEGES;
>Query OK, 0 rows affected (0.00 sec)
>
>mysql> quit
>Bye
>
>Need I be concerned about the "zero rows affected" warning?
I do not have MySQL installed anywhere to try the commands to give you
a certain answer to that (I use MariaDB), but I think that it is fine.
>Have I been clear that this is a new install of Ubuntu DeskTop 16.04 and
>that Myth setup has never been opened?
No, and that may explain the next problem below.
>Trying to restore again gives:
>
>daryl at trieli:~$ sudo ./mythconverg_restore.pl --create_database --directory
>~ --filename mythconverg-1344-20180804112717.sql.gz --verbose
>
>Configuring environment:
> - username: root
> - HOME: /home/daryl
> - MYTHCONFDIR: /home/daryl/.mythtv
>
>Parsing configuration files:
> - checking: /home/daryl/.mythtv/config.xml
> - checking: /usr/local/share/mythtv/mysql.txt
> - checking: /usr/share/mythtv/mysql.txt
> - checking: /usr/local/etc/mythtv/mysql.txt
> - checking: /etc/mythtv/mysql.txt
> - checking: /home/daryl/.mythtv/mysql.txt
> - checking: mysql.txt
> - checking: /home/daryl/.mythtv/mysql.txt
> - checking: /home/daryl/.mythtv/backuprc
>
>Applying command-line arguments.
>
>Checking configuration.
>
>WARNING: DBName not specified. Using mythconverg
>
>WARNING: DBHostName not specified.
> Assuming it is specified in the MySQL options file.
>
>WARNING: DBUserName not specified.
> Assuming it is specified in the MySQL options file.
>
>WARNING: DBPassword not specified.
> Assuming it is specified in the MySQL options file.
>
>Database Information:
> DBHostName:
> DBPort: -1
> DBUserName:
> DBPassword:
> DBName: mythconverg
> DBSchemaVer:
> DBBackupDirectory: /home/daryl
> DBBackupFilename: mythconverg-1344-20180804112717.sql.gz
> drop_database: no
> create_database: yes
>
>Executables:
> mysql_client: mysql
> uncompress: gzip -d
>
>Miscellaneous:
> partial_restore: no
> restore_xmltvids: no
> change_hostname: no
>
>Checking database.
>DBI connect('host=:database=mythconverg','',...) failed: Access denied for
>user 'root'@'localhost' (using password: NO) at ./mythconverg_restore.pl
>line 933.
>
>Preparing initial database.
>DBI connect('host=','',...) failed: Access denied for user 'root'@'localhost'
>(using password: NO) at ./mythconverg_restore.pl line 933.
>
>Unable to connect to database.
> database: mythconverg
> host:
> username:
> password:
>
>Please check your configuration files to verify the database connection
>information is correct. The files that are used to retrieve connection
>information are prefixed with "parsing" in the "Parsing configuration files"
>section of the --verbose output.
>
>Also note that any [client] or [mysql] password specified in the MySQL
>options
>file (/etc/my.cnf or /etc/mysql/my.cnf or ~/.my.cnf) will take precedence
>over
>the password specified in the MythTV configuration files.
>
>ERROR: Unable to connect to database.
From that, it appears that mythconverg_restore.pl is not finding a
config.xml or mysql.txt file to use for the user/password to access
the database. First, check if you have a /etc/mythtv directory. If
it is there and contains a config.xml file, then you should link to it
from the other places a config.xml file is needed, see below.
If there is not a /etc/mythtv directory or it does not contain a
config.xml file, then you need to create and populate it. I suspect
that running mythtv-setup will do that, so I would try that first,
from user "daryl". Do not bother to actually set up anything inside
mythtv-setup, as anything you do will be overwritten by the database
restore. Mythtv-setup may object to that and not want to exit, but
just answer the "do you really want to exit" type questions with "yes
I do" and exit it. Then check the following locations for config.xml
files:
/etc/mythtv/config.xml
/home/mythtv/.mythtv/config.xml
/home/daryl/.mythtv/config.xml
You need a config.xml file in each of those places. I have found that
in most circumstances, it is best to have just one config.xml file in
/etc/mythtv/config.xml and link to it from all other locations. So if
you now have a /etc/mythtv/config.xml file, then do this:
sudo rm /home/mythtv/.mythtv/config.xml
sudo rm /home/daryl/.mythtv/config.xml
sudo mkdir /home/mythtv/.mythtv
sudo chown mythtv:mythtv /home/mythtv/.mythtv
sudo mkdir /home/mythtv/.mythtv
sudo chown daryl:daryl /home/mythtv/.mythtv
sudo ln -s /etc/mythtv/config.xml /home/mythtv/.mythtv/config.xml
sudo ln -s /etc/mythtv/config.xml /home/daryl/.mythtv/config.xml
Do not worry if there are any error messages on any of those commands
except the "sudo ln" ones.
Then check the /etc/mythtv/config.xml file and see if it has a
password you are happy with. If not, then create a new password
(using apg?) and edit it into the /etc/mythtv/config.xml file. To
edit /etc/mythtv/config.xml, this should work:
sudo nano /etc/mythtv/config.xml
If nano is not installed, install it and try again:
sudo apt install nano
Then you can try restoring the database again.
More information about the mythtv-users
mailing list