[mythtv-users] Nuvexport and re-importing

Michael T. Dean mtdean at thirdcontact.com
Thu Jun 9 08:13:30 UTC 2005


scott urban wrote:

>On Thu, Jun 09, 2005 at 00:16:03, Chris Clarke spake thusly:
>  
>
>>Here's my problem, I used nuvexport to export 300ish recordings
>>and so I've got 300+ .nuv files and 300+ .sql files.  I understand
>>that if I move the .nuv file and then run the command "mysql -u root
>>-p mythconverg < XXXX.sql" it will reinsert it into the database, I
>>just don't feel like doing it 300+ times :)  Is there some way I can
>>either combine the .sql files into 1 giant .sql file with all the info
>>or tell mysql to import all the .sql files?  (Excuse the newbie
>>question, I couldn't find the answer in the archives....)
>>    
>>
>I'm no SQL wiz, but this seems like a shell problem:
>
>  sh%> for f in *.sql ; do 
>  for> echo $f
>  for> mysql -u root -p mythconverg < $f
>  for> done
>  
>
Ouch.  That would require entering the password 300 times.  If doing 
that, at least put the password in your .my.cnf file ( 
http://dev.mysql.com/doc/mysql/en/option-files.html ).

Or, you could probably do:

mysql -u mythtv -p mythconverg < `cat *.sql`

Which passes all the SQL commands into mysql in the same instance.  (You 
shouldn't need to run it as MySQL root since mythtv should have full 
access to mythconverg).

That's the great thing about *nix--there's a million ways to accomplish 
anything.  :)

Mike


More information about the mythtv-users mailing list