[mythtv-users] UPDATED: Bash/MySQL script for copying and/or deleting mythfrontend profiles

Matt Beadon matt.beadon at gmail.com
Tue Jan 12 21:14:02 UTC 2010


>
> BTW it works like a charm and now I can see my myth recordings on my
> XP laptop -- woohooo....
>
> Here is an updated version of the code with some minor usability
> enhancements:
>

Great timing (for me)!  I just got my new laptop running last night and
fired up myth FE only to realize that I'd have to spend ages getting the
settings cloned from my existing FE before I'd be happy using it. :(  Then I
found this thread, thanks!  Haven't run it yet but I will when I get home.

I'm interested in the delete hostname function since I happen to have a few
leftover invalid entries in my DB from changing my hostname without doing it
the "mythtv way".

I'm not very familiar with mysql but I'd like to make the following
suggestions that I think would go really nicely with the current functions:
1) list all hostnames that have some configuration info in the DB.  This
will let people like me clean up after their mistakes more easily using your
delete hostname command.  :)
2) grant privileges to user at hostname (or user@"192.168.1.%" or some other
wildcard for home networks) to allow the new FE to connect to the DB since
by default only mythtv at localhost is allowed.  The syntax for this is shown
on this wiki http://www.mythtv.org/wiki/MythFrontend
3) similar to delete hostname: revoke privileges to users/hostnames that
were added by mistake.  After way too long online I cobbled together the
following commands for example:
use mysql;
select HOST, User from user;  [to show my mistakes like adding
username=oops]
show grants for oops@"localhost";  [check that the user doesn't have access
to mysql for some app other than mythtv]
delete from user where host = "localhost" and user = "oops";  [clean up
entries]

Hmm #3 seems to involve more human interaction and double checking than I'd
really suggest for a script... perhaps that one's a bad idea?  At least now
I'll have those commands saved in this thread.

I still think that #1 would be great and perhaps #2 could be added as a
function within the copy hostname?  That way the new hostname is completely
ready to go after the copy.

cheers,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20100112/b9801681/attachment.htm>


More information about the mythtv-users mailing list