Linux command
influx 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start interactive shell
influx
Connect to host
influx -host [hostname] -port [8086]
Execute query
influx -execute "[SELECT * FROM measurement]"
Use specific database
influx -database [mydb]
Import data
influx -import -path [data.txt]
Execute query
influx -database [mydb] -execute "[SELECT * FROM measurement]" -format json
Authenticate
influx -username [user] -password [pass]
说明
influx is the command-line interface for InfluxDB time-series database. It provides an interactive shell for querying and managing data. The v1 CLI uses direct connection flags (-host, -port, -username) and supports InfluxQL. The v2 CLI is a separate tool that uses token-based authentication and configuration profiles, supporting both InfluxQL and Flux query languages. The options documented here apply to the v1 CLI.
参数
- -host _HOST_
- InfluxDB server hostname.
- -port _PORT_
- Server port (default 8086).
- -database _DB_
- Database to use.
- -execute _QUERY_
- Execute query and exit.
- -import
- Import data from file.
- -path _FILE_
- File path for import.
- -username _USER_
- Authentication username.
- -password _PASS_
- Authentication password.
- -precision _UNIT_
- Timestamp precision (ns, u, ms, s, m, h).
- -ssl
- Use HTTPS for requests.
- -format _FORMAT_
- Output format: column, csv, json (default: column).
- -type _TYPE_
- Query type: influxql or flux.
- --help
- Display help information.
FAQ
What is the influx command used for?
influx is the command-line interface for InfluxDB time-series database. It provides an interactive shell for querying and managing data. The v1 CLI uses direct connection flags (-host, -port, -username) and supports InfluxQL. The v2 CLI is a separate tool that uses token-based authentication and configuration profiles, supporting both InfluxQL and Flux query languages. The options documented here apply to the v1 CLI.
How do I run a basic influx example?
Run `influx` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -host _HOST_ do in influx?
InfluxDB server hostname.