Closes #1356
parent
00c2c16a5d
commit
e8e4b4dcb5
|
@ -22,24 +22,23 @@ influx [command]
|
|||
```
|
||||
|
||||
{{% note %}}
|
||||
#### Store your InfluxDB authentication token
|
||||
To avoid having to pass your InfluxDB [authentication token](/v2.0/users/tokens/)
|
||||
with each `influx` command, use one of the following methods to store your token:
|
||||
#### Set your credentials
|
||||
|
||||
1. Set the `INFLUX_TOKEN` environment variable using your token.
|
||||
1. To avoid having to pass your InfluxDB [authentication token](/influxdb/v2.0/security/tokens/view-tokens/) with each `influx` command, set up a configuration profile if you haven't already.
|
||||
2. To see if you have a configuration profile, run `influx config`. If nothing is displayed, you don't have a configuration profile.
|
||||
3. To configure a profile, in a terminal, run the following command:
|
||||
|
||||
```bash
|
||||
export INFLUX_TOKEN=oOooYourAuthTokenOoooOoOO==
|
||||
```
|
||||
```sh
|
||||
# Set up a configuration profile
|
||||
influx config create -n default \
|
||||
-u http://localhost:9999 \
|
||||
-o example-org \
|
||||
-t mySuP3rS3cr3tT0keN \
|
||||
-a
|
||||
```
|
||||
|
||||
2. Store your token in `~/.influxdbv2/credentials`.
|
||||
_The content of the `credentials` file should be only your token._
|
||||
|
||||
If you [set up InfluxDB using the CLI](/v2.0/reference/cli/influx/setup),
|
||||
InfluxDB stores your token in the credentials files automatically.
|
||||
|
||||
_See [View tokens](/v2.0/security/tokens/view-tokens/) for information about
|
||||
retrieving authentication tokens._
|
||||
This configures a new profile named `default` and makes the profile active so commands run against this instance.
|
||||
For more detail, see [influx config](/influxdb/v2.0/reference/cli/influx/config/).
|
||||
{{% /note %}}
|
||||
|
||||
## Commands
|
||||
|
|
Loading…
Reference in New Issue