
agraham at g-b
May 12, 2008, 5:31 PM
Post #14 of 14
(404 views)
Permalink
|
|
Re: How to delete encoders from mythtv database
[In reply to]
|
|
Hi Mike, Fixed, thank you for the points - I really didn't want to start over again :( Basically I backed up the broken database, them created a separate "tablname".sql for each table in the database using a script like the following. === Start ==== #!/bin/sh filename="tables.txt" # This is a file that contains tables names - 1 per line backup="backup.sql" # contains a backup of the original database cat $filename| \ while read line;do if [ -n "$line" ]; then # echo "-> $line" echo "grep \"INSERT INTO \`$line\` \" "$backup" > \"tmp/${line}.sql\"" grep "INSERT INTO \`$line\` " "$backup" > "tmp/${line}.sql" mysql -u root mythconverg < tmp/${line}.sql fi done =========== When I got Duplicate keys, I removed that table name from the tables.txt file, then restored the 'new clean" database and re-ran the above script - so I get no errors - managed to keep 60 tables - so I'm a happy camper. Anyway, thanks for you help, very very much appreciated. Albert. Michael T. Dean wrote: > On 05/11/2008 06:57 PM, Albert Graham wrote: > >> That thread assumes a perfect world, my database seems to have lots of >> configurations for lost of hostnames >> get duplicate key errors when I run that sql. >> >> Is it possible to clean up the databases and remove any references to >> non-existing host names, if so how ? >> >> > > Spring cleaning: http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7 > > Basically, first, make sure you have a backup of the "most-working" > state of the database. Then, drop the DB, then run mc.sql, then start > and exit mythtv-setup (allowing it to upgrade the database). Then, > follow the instructions in the link above (ideally using the > new-hostname database backup on which you ran the new-hostname sed > commands). If everything imports correctly (i.e. without duplicate key > errors), you're good to go (and begin to reconfigure your Myth box with > mythtv-setup, then mythfrontend settings). > > If the 23.7 tables don't import cleanly, let me know and I'll give you a > more involved process. > > >> Also, I don't think this is the root of my problem, because every single >> other function works, including TV listings and watching and recording >> from TV ? >> > > I think the current state of the database is the root of the problem. > How it got into the current state isn't too important. Just do as > above, and it should fix it. > > Mike > _______________________________________________ > mythtv-users mailing list > mythtv-users[at]mythtv.org > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users > _______________________________________________ mythtv-users mailing list mythtv-users[at]mythtv.org http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
|