But, the Influxdb returns HTTP status code, 400.
And the error message, returned as json format, is as follows:
"{\"error\":\"error parsing query: found USE, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1\"}\n".
I have checked if the Influxdb is working properly with “influx.exe” in the command line.
The results is shown below. As can be see, Influxdb is working well.
(the “my_database” is “tick_data”.)
Microsoft Windows [Version 10.0.17134.590]
(c) 2018 Microsoft Corporation. All rights reserved.
D:\Program Files (x86)\influxdb\1.5.2-1>influx
Connected to http://localhost:8086 version 1.5.2
InfluxDB shell version: 1.5.2
> show databases
name: databases
name
----
_internal
test_1111
tick_data
> use tick_data
Using database tick_data
>
Could anybody tell me what is problem of my http query?
and this works. I could check that the database “test_9999” was created.
After seen this query, I thought that the syntax of my previous http query could be wrong.
So I tried modified http query like this,
use [ "<database_name>" | "<database_name>"."<retention policy_name>" ] Sets the current database and/or retention policy. Once influx sets the current database and/or retention policy, there is no need to specify that database and/or retention policy in queries. If you do not specify the retention policy, influx automatically queries the use d database’s DEFAULT retention policy.
In InfluxQL, the FROM clause provides several formats for specifying a measurement, including “fully qualified” measurements, which allow you to specify which database and retention policy the query should use:
FROM <database_name>.<retention_policy_name>.<measurement_name> Returns data from a fully qualified measurement. Fully qualify a measurement by specifying its database and retention policy.