zhibo/diagnose_live_status.sql

31 lines
1018 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 诊断直播间状态问题
-- 1. 查看所有直播间及其状态
SELECT id, title, streamer_id, streamer_name, status, is_live,
stream_key, rtmp_url, hls_url, flv_url,
create_time, update_time
FROM eb_live_room
ORDER BY id DESC
LIMIT 10;
-- 2. 查看直播间状态字段含义
-- status: 1=正常, 0=禁用
-- is_live: 1=正在直播, 0=未开播
-- 3. 检查是否有正在直播的房间
SELECT COUNT(*) as live_count FROM eb_live_room WHERE is_live = 1;
-- 4. 手动将某个直播间设置为直播中(测试用)
-- 假设直播间ID为1执行以下SQL
-- UPDATE eb_live_room SET is_live = 1 WHERE id = 1;
-- 5. 查看推流地址配置
SELECT id, title, stream_key,
CONCAT('rtmp://1.15.149.240:1935/live/', stream_key) as rtmp_push_url,
CONCAT('http://1.15.149.240:8083/live/', stream_key, '.flv') as flv_play_url,
CONCAT('http://1.15.149.240:8083/live/', stream_key, '.m3u8') as hls_play_url
FROM eb_live_room
WHERE status = 1
ORDER BY id DESC
LIMIT 5;