1年くらいWEB画面上から録画削除処理してなかったら大量に残ってたので、ぽちぽち1件ずつ削除する野面倒になってDB直接弄ってみることに
# mysql -u root -p
でログイン。
データベース何があるか確認
# show databases;
- +
Database
- +
information_schema hoge mysql test
- +
hogeデータベースで確保している場合、テーブルの内容確認
# use hoge;
# show tables;
- +
Tables_in_hoge
- +
Recorder_categoryTbl Recorder_channelTbl Recorder_keywordTbl Recorder_logTbl Recorder_programTbl Recorder_reserveTbl
- +
とテーブル確認すると「Recorder_reserveTbl」とあるのでこれをチェック。
# describe Recorder_reserveTbl;
- +
Field Type Null Key Default Extra
- +
id int(11) NO PRI NULL auto_increment channel_disc varchar(128) NO MUL none channel_id int(11) NO 0 program_id int(11) NO 0 type varchar(8) NO GR channel varchar(10) NO 0 title varchar(512) NO none description varchar(512) NO none category_id int(11) NO 0 starttime datetime NO MUL 1970-01-01 00:00:00 endtime datetime NO 1970-01-01 00:00:00 job int(11) NO 0 path blob YES NULL complete tinyint(1) NO 0 reserve_disc varchar(128) NO none autorec int(11) NO 0 mode int(11) NO 0 dirty tinyint(1) NO 0
- +
と、Field構成が確認できるので、これを元にデータを参照に
# select id, starttime, complete from Recorder_reserveTbl where complete = 1 and id < 1000 order by id asc;
~~~
2488 2015-05-02 01:44:50 1 2489 2015-05-03 17:29:50 1 2490 2015-05-03 22:29:50 1 2491 2015-05-03 22:59:50 1 2493 2015-05-03 00:29:50 1 ~~~
な感じでヒットしたデータが列ぶので、消したい条件でDeleteする
# delete from Recorder_reserveTbl where complete = 1 and id < 2500;
こんな感じでOK
基本的にid順に収録しているようだったのでidで削除したけど、starttimeで日付指定して削除する方が安全かな
# delete from Recorder_reserveTbl where starttime < '2015-05-15';
な感じで。