[mythtv-users] Restoring backup to a new backend
Michael T. Dean
mtdean at thirdcontact.com
Thu Sep 24 16:50:27 UTC 2015
On 09/24/2015 11:03 AM, Paul Stillwell wrote:
> I looked at the myth converge_restore.pl script and it looks like if
> you pass it —drop_database and —create_database then it will do the
> same thing as ‘mysql -u root < mc.sql’. I’m assuming that it will then
> restore the database based on the file passed in or the place where it
> is pointed to by the backuprc file. If the database is restored after
> —drop_database and —create_database then can I run the mysql commands
> to set the username and password (the ‘mysql>’ commands above)? I’m
> not familiar with databases so I don’t know if things need to get done
> in a certain order or not.
>
You have to have a valid MySQL(/MariaDB) user account with sufficient
permissions to do what the script does. If you use the script to drop a
database and create a database, the MySQL user being used by the script
to run the commands must have permission to do so.
If you're using a MySQL that's never had any mythconverg database in it
and has never had a mythtv user created, you'd likely have to run the
mythconver_restore.pl script with the MySQL root username/password.
If, however, you're running the script on a MySQL server that has (or
previously had) a mythconverg database and a properly-configured MySQL
user for MythTV (meaning one for whom GRANT ALL ON mythconverg) was
specified, you can use the MySQL user for MythTV (usually mythtv) to run
the script and to --drop-database --create-database (because mythtv has
ALL permissions on mythconverg). And, if that's the case--you already
have a properly-configured MySQL user for MythTV--you have no need to
run commands to create a MySQL user for MythTV, nor to set the password
for the MySQL user for MythTV.
As a matter of fact, the entire reason the --drop-database and
--create-database arguments were added to the script is because
different distros use different approaches to create users (and
passwords) for the MySQL user for MythTV. When users did ‘mysql -u root
< mc.sql’ or the commands inside it, it tended to break those MySQL user
accounts (either shadowing permissions or changing passwords on some
connections but not others or ...).
So, if you're using a MySQL server on which you've already had a
mythconverg database, don't do any mc.sql stuff at all.
Mike
More information about the mythtv-users
mailing list