View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 4 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Mon Apr 27, 2009 11:07 pm 
Offline
Joined: Sun Sep 25, 2005 3:50 pm
Posts: 1013
Location: Los Angeles
I'm running R6 and I accidently hosed my channel table. I was able to "fix" it, but I just could not duplicate my channel mappings the way I used to have it. I'm not so good at mysql, but I'd like to extract my old channel table from my mythconverg.sql.gz. Can anyone help me accomplish this?

_________________
Mike
My Hardware Profile


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 28, 2009 1:52 am 
Offline
Joined: Tue Feb 03, 2004 3:23 am
Posts: 159
Location: Friesland, The Netherlands
You could try this:

Code:
zcat mythconverg.sql.gz | grep "INSERT INTO \`channel\` VALUES" > channel-table.sql


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 28, 2009 9:41 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
1) Make another backup before you start messing with the DB!

2) Beware that using that naked insert may either cause duplicates or fail depending on the key settings for that table. You either need to clean the table out first or drop/recreate it. Cleaning it out is simpler and probably adequate, this should do the trick.
Code:
delete from channel;


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 29, 2009 12:19 am 
Offline
Joined: Sat Feb 03, 2007 12:52 am
Posts: 187
Location: Manitoba, Canada
I usually hand edit the file. I'm not confident with my grep skills.
Anything after
Code:
-- Table structure for table `channel`

will drop the table and recreate a blank table structure to avoid duplicates and reset the auto increment counter if applicable.
Code:
-- Dumping data for table `channel`

The stuff after this is the data your looking to keep.
Something like this should load it
Code:
mysql -u mythtv -p -D mythconverg < backup.file.name


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu