建表失败,报错DB error: Database not specified [0x80002616] (0.000144s)

CREATE STABLE IF NOT EXISTS st_uav_alarm_event (
ts TIMESTAMP,
receive_time TIMESTAMP,
alarm_id BINARY(64),
flight_id BINARY(64),
msg_id BINARY(64),
event_type TINYINT,
alarm_level TINYINT,
lng DOUBLE,
lat DOUBLE,
height FLOAT,
speed FLOAT,
threshold_value FLOAT,
actual_value FLOAT,
duration_seconds INT,
alarm_detail BINARY(512),
point_city_code BINARY(12),
point_county_code BINARY(12),
area_id BINARY(64),
area_name BINARY(128)
) TAGS (
source BINARY(16),
uav_code BINARY(64),
drone_sn BINARY(64),
alarm_type TINYINT,
owner_id BINARY(64),
owner_type TINYINT,
org_id BINARY(64),
owner_city_code BINARY(12),
owner_county_code BINARY(12)
);

没有指定 数据库。两种解决方法:
1、创建表之前,先 use ;
2、在建表语句中直接指定 数据库名:
CREATE STABLE IF NOT EXISTS .st_uav_alarm_event ……….;

找到原因了,使用event_type的原因,保留字

1 个赞