Grafana 选择查询抛出错误 - “找不到名为 time 或 time_sec 的列”

mea*_*our 2 mysql grafana grafana-templating grafana-variable

我正在使用 Grafana mysql 数据连接器并尝试编写选择查询。选择查询抛出错误 -"Found no column named time or time_sec"

Here is the query
SELECT main_id, ipaddress FROM table1;
Run Code Online (Sandbox Code Playgroud)

dro*_*bot 5

当您使用“图形”可视化,并将 X 轴模式设置为“时间”时,会发生这种情况,因为 grafana 试图找到要映射图形的时间序列:

带时间模式的图形可视化

从您的查询来看,您似乎正在寻求可视化没有时间序列的数据。

根据您正在使用的数据和您的目标,可以:

  • 将 X 轴模式更改为“系列”并选择相关的数字列来映射 X 轴
  • 或者选择“图表”之外的更合适的可视化
  • 或者将查询更改为具有“时间”列