Re: Re: [mythtv-users] removing from mysql database

admin at mythppv.com admin at mythppv.com
Sat Mar 19 05:14:01 UTC 2005


Removing a recording (without the GUI) takes a little work, but its not
too hard.



First log into your database by running mysql
 - first try just typing mysql
 - if that doesn't work try mysql  -u <database name>  -p <username>

This should have opened up a mysql> prompt.  


Note: the semi-colon ; finishes the statements in mysql, so make sure
use use the ; before hitting enter.  If you do hit enter before doing a
semi-colon, just type one and hit enter.


Once you are at the prompt type   

mysql> use mythconverg;


Next lets get some key information, like the chanid.
** Replace 123 with the channel the recording was recorded on.

mysql> select channum, chanid, callsign from `channel` where channum =
"123";
+---------+--------+----------+
| channum | chanid | callsign |
+---------+--------+----------+
| 123     |   1123 | MyChan   |
+---------+--------+----------+
1 row in set (0.00 sec)


Now that we have the chanid, lets find the start-time so we can start
the delete process.  

mysql> select chanid, starttime, title from recorded where chanid =
1176;
+--------+---------------------+----------+
| chanid | starttime           | title    |
+--------+---------------------+----------+
|   1123 | 2005-03-06 03:30:00 | That one |
|   1123 | 2005-03-10 08:00:00 | That one |
|   1123 | 2005-03-13 23:30:00 | That one |
|   1123 | 2005-03-15 00:30:00 | Another  |
+--------+---------------------+----------+
6 rows in set (0.00 sec)


Look at the above row to find the correct starttime of the program you
want to delete.  For this example, lets say its "That one" that started
on 2005-03-10 08:00:00.


So lets query the database to find that particular show in the tables.

mysql> select chanid, starttime, title from recorded where chanid = 1123
and starttime = "2005-03-10 08:00:00";

mysql> select chanid, starttime, title from record where chanid = 1123
and starttime = "2005-03-10 08:00:00";

Both lines should have outputted something like this.  Verify its what
you want deleted.
+--------+---------------------+-----------+
| chanid | starttime           | title     |
+--------+---------------------+-----------+
|   1123 | 2005-03-10 08:00:00 | That one  |
+--------+---------------------+-----------+
1 row in set (0.00 sec)


Now lets delete this program.

mysql> delete from recorded where chanid = 1123 and starttime =
"2005-03-10 08:00:00";

mysql> delete from recorded where chanid = 1123 and starttime =
"2005-03-10 08:00:00";


Now exit mysql 
mysql> quit;


Now those programs should be gone.

Enjoy









Sasha Z <kleptophobiac at gmail.com> wrote on 03/19/2005, 03:24:42 AM:
> I have a recording that didn't even make a file - it failed
> completely. I too am interested in a manual removal method.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


More information about the mythtv-users mailing list