[mythtv-users] Re: Clean 0.15 install, what should I save from the old DB?

Aleaxander alex at carbonated.com
Sun Jun 6 03:53:55 EDT 2004


Bruce Markey wrote:

> Aleaxander wrote:
> 
>> I'm trying to restore information from my 0.14 database into a clean 
>> install of 0.15 (Fedora Core 1).  Searching the list archives, I found 
>> the following information on how to do this:
>>
>> ----
>> Restore the information from "record' (the titles you've chosen
>> to record), 'recorded' (the descriptive info for your recording),
>> 'oldrecorded' (for finding duplicates that you've recorded previously)
>> and 'recordedmarkup' (keyframe seek info, commercial skipping, etc).
>>
>> grep "INSERT INTO record " mythtv_backup.sql > restore.sql
>> grep "INSERT INTO recorded " mythtv_backup.sql >> restore.sql
>> grep "INSERT INTO oldrecorded " mythtv_backup.sql >> restore.sql
>> grep "INSERT INTO recordedmarkup " mythtv_backup.sql >> restore.sql
>>
>> Note the space after the table name and the ">>" to append to the
>> file for all but the first grep. "recordedmarkup" is huge and
>> may be hundreds of thousands of lines if you had lots of hours
>> of recordings.
>>
>> If your hostname has changed, bring up restore.sql in an editor
>> to search and replace your old hostname with the new one being
>> careful to not replace if your old hostname appears in a show's title 
>> or description .
>>
>> Once your file is ready to go:
>>
>> $ mysql -u mythtv -pmythtv mythconverg < restore.sql
>> ----
>>
>> Everything looked good until I did the last step, and then received 
>> the following error:
>>
>> ERROR 1054 at line 1: Unknown column 'recorddups' in 'field list'
>>
>> Looking at a backup of the 0.15 mythconverg database I made before I 
>> started trying to restore information from the 0.14 database I see 
>> that there is no recorddups field present.  Anyone have any idea what 
>> I am doing wrong or suggestions on how I can proceed?
> 
> 
> That column was dropped and replaced with two other columns.
> 
>  ALTER TABLE record ADD COLUMN recorddups INT DEFAULT 0 NOT NULL;
> 
> Run the restore command again then:
> 
>  UPDATE record SET dupmethod = 1 WHERE recorddups = 2;
>  UPDATE record SET dupin = 2 WHERE recorddups = 1;
>  ALTER TABLE record DROP COLUMN recorddups;
> 
> --  bjm

I'm sorry to say that I am relatively new at altering mysql databases 
(as well as Linux in general), so I apologize for asking what I'm sure 
is a stupid question.  I did check the man file for mysql, but there was 
  nothing there that looked applicable.  This is the problem I'm having:

I brought up the mysql prompt by entering
$mysql -u root -p

Then I entered:
mysql>ALTER TABLE record ADD COLUMN recorddups INT DEFAULT 0 NOT NULL;

But it gave me the following error:
ERROR 1046: No Database Selected

So then I tried adding "mythconverg" to the end of the command, but got 
this error:
ERROR 1064: You have an error in your SQL syntax near 'mythconverg' at 
line 1

Any help would be greatly appreciated.  Mythtv has been offline for this 
upgrade for about a week now, and my wife is really starting to get 
annoyed : )

-Alex


More information about the mythtv-users mailing list