InfluxDB is a time series database designed to handle high write and query loads. In this guide, we'll go over how to install and use some of the basic commands of InfluxDB.
To install InfluxDB, you can refer to the official documentation for Version 1.7. Follow the instructions specific to your operating system to install it correctly.
Once InfluxDB is installed, you can access its command-line interface by using the following command:
influx
To exit the InfluxDB command-line interface, use:
exit
Or alternatively:
close
InfluxDB organizes data into databases. Below are the essential commands to create, use, and delete databases.
To create a new database, use the following command:
CREATE DATABASE my_database
To list all available databases, use:
SHOW DATABASES
If you want to start working with a specific database, use the USE command:
USE my_database
To delete a database, use the DROP command followed by the database name:
DROP DATABASE my_database
Be cautious when using this command, as it permanently deletes all data in the specified database.
Measurements in InfluxDB are similar to tables in relational databases. Before working with measurements, ensure you're using the correct database by issuing the USE command.
To query and select all data from a specific measurement, use:
SELECT * FROM "my_measurement"
To view all available measurements in the current database, use:
SHOW MEASUREMENTS
To delete a specific measurement from the database, use:
DROP MEASUREMENT "my_measurement"
This will permanently delete all data associated with the specified measurement.
InfluxDB can be integrated with other platforms and services to visualize or automate data management. For example, you can integrate it with Node-RED for automation and dashboard creation.
To learn more about using InfluxDB with Node-RED, refer to the following guide:
Node-RED and InfluxDB Integration