[mythtv-users] Mythtv automatically going to a source

Michael T. Dean mtdean at thirdcontact.com
Wed Aug 27 06:12:09 UTC 2008


On 08/27/2008 01:55 AM, Jean-Yves Avenard wrote:
> 2008/8/27 Michael T. Dean:
>   
>> Right, your MySQL user (mythtv?) probably has create database
>> privileges, but may not have GRANT privileges and almost definitely
>> doesn't have the privilege required to run "FLUSH PRIVILEGES;" so
>> running mc.sql would fail, leaving a DB without any tables.
> I see...
>
> Is there an option to specify which mysql user and password to use instead?
>   

You'd specify a different user with --username, i.e. --username=root.  
However, the script was create to prevent passing a password on the 
command line (which would allow it to be seen by other processes), so 
you'd have to specify the password in the backup resource file, meaning 
that it's probably easier to specify both in the backup resource file.

(I won't mention that there are some commented out lines in 3 different 
parts of both the backup and restore scripts marked with, "# This script 
does not accept a database password on the command-line.", that--if 
properly uncommented--would allow passing a password on the command 
line, because I don't want to encourage people to do things wrongly.)

> In any case ; some informational error message would be good ; rather
> than the generic error "database not empty"...
>
> For some reasons, the restore script did create the database though
> and put data in them ; just that it wasn't complete.
>
> So if it can create the database and start creating the tables ; you
> would think it would work for everything else (I can't remember what
> rights I granted to the default mythtv user)
>   

The FLUSH PRIVILEGES; statement requires RELOAD privilege, which is 
generally only given to the server administrator (root account).  The 
script considers any failure in the execution of mc.sql as fatal 
(because unless the final statement in mc.sql--the "ALTER DATABASE 
mythconverg DEFAULT CHARACTER SET latin1;"--executes successfully, you 
will almost definitely have a DB that won't be able to be upgraded to 
0.22's schema.

>> Thanks, again,
>>     
> Thank you for providing this great tool ...
>
> Just one week running it and it has saved me of the problem I
> mentioned earlier !

I hope it's useful to many people.

Mike


More information about the mythtv-users mailing list