This topic describes how to create, modify, and delete a Time Series Database (TSDB) for InfluxDB® database and the user account used to manage the database. This topic also describes how to grant permissions to the user account.
Prerequisites
A Time Series Database (TSDB) for InfluxDB® instance is purchased. For more information, see Create a TSDB for InfluxDB® instance.
Account types
TSDB for InfluxDB® instances support two types of accounts: administrator and standard accounts. You can manage all your accounts and databases in the TSDB console. For more information about permissions that can be granted to each type of account, see Accounts and permissions.
Account type | Description |
Administrator account | You can create and manage an administrator account only in the console. You can create only one administrator account for each instance. The administrator account can manage all databases on the instance. The administrator account cannot create or manage other accounts. The administrator account has all permissions on all databases on the instance for which the account is created. |
Normal Account | You can create and manage standard accounts only in the console. You can create multiple standard accounts for each instance. A standard account cannot create or manage other accounts. You must grant permissions on specific databases to standard accounts in the console. A standard account can perform read and write operations on the database that this account is authorized to manage. |
Manage accounts
Create an account
Log on to the TSDB console.
In the upper-left corner of the console, select the region in which your instance is located.
On the Instances page, click Manage in the Actions column corresponding to the instance.
Choose Time Series Data Management > Accounts. On the Accounts page, click Create.
On the Create Account page, configure the parameters described in the following table.
Parameter
Description
Account Name
Enter the name of the account. The account name must meet the following requirements:
The name can contain only lowercase letters, digits, and underscores (_).
The name must start with a lowercase letter and end with a lowercase letter or a digit.
The name must be 1 to 16 characters in length.
Account Type
Administrator Account: Only one administrator account can be created for an instance.
NoteBy default, the administrator account has the owner permissions on all the databases that are created on the instance. You can reset the permissions of the administrator account.
Standard Account: You can select the Standard Account option only after an administrator account is created for your instance. Each instance can have more than one standard account.
NoteYou must manually grant standard accounts the permissions on databases.
Standard accounts can be deleted.
Authorize Database
You must grant permissions on databases to standard accounts.
You can perform the following steps to grant permissions on more than one database to the standard account:
In the Unauthorized Databases section, select the databases on which you want to grant permissions to the account.
NoteIf no databases are created on the instance, create databases before you grant permissions on databases.
Click Authorize > to add the selected databases to the Authorized Databases section.
Grant the permissions on each selected database to the standard account. The following permission types are supported: Read/Write, Read, and Write.
NoteYou can grant the permissions on each selected database to the standard account. The following permission types are supported: Read/Write, Read, and Write.
Password
Enter the password of the account. The password must meet the following requirements:
The password must be 8 to 32 characters in length.
The password contains at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters.
Special characters include ! @ # $ % ^ & * ( ) _ + - =
Confirm Password
Enter the password of the account again.
Click OK.
Delete an account
Log on to the TSDB console.
In the upper-left corner of the page, select the region in which your instance is located.
On the Instances page, click Manage in the Actions column corresponding to the instance.
Choose Time Series Data Management > Accounts. On the Accounts page, click Delete in the Actions column corresponding to the account that you want to delete.
Click OK.
Manage databases
Create a database
Log on to the TSDB console.
In the upper-left corner of the page, select the region in which your instance is located.
On the Instances page, click Manage in the Actions column corresponding to the instance.
Choose Time Series Data Management > Databases. On the Databases page, click Create in the upper-right corner.
On the Create Database dialog box, enter the name of the database that you want to create, and then click OK.
If you create a large number of databases in an instance, data is distributed among the databases, which consumes memory resources and degrades the query performance. We recommend that you create no more than 10 databases in an instance.
Delete a database
Log on to the TSDB console.
In the upper-left corner of the page, select the region in which your instance is located.
On the Instances page, click Manage in the Actions column corresponding to the instance.
Choose Time Series Data Management > Databases. On the Databases page, click Delete in the Actions column corresponding to the database that you want to delete.
Click OK.
Manage permissions
You can modify the read and write permissions of a standard account on specific databases.
For example, you can grant the read/write permission on the mydb
database to the standard account db_test.
Permissions of the administrator account
The administrator account of an instance has the full permission on all the databases that are created on the instance.
Account permissions
Account type | Permission type | Object | Permission | ||||
Standard account | Read/write | Database | SHOW DATABASES | USE (DATABASE) | |||
Data operation | SELECT | INSERT | DELETE (FROM) | CARDINALITY | SHOW TAG KEY (EXACT) CARDINALITY | ||
SHOW TAG VALUES (EXACT) CARDINALITY | SHOW FIELD KEY (EXACT) CARDINALITY | SHOW MEASUREMENT (EXACT) CARDINALITY | SHOW TAG KEYS | SHOW TAG VALUES | |||
SHOW FIELD KEYS | SHOW QUERIES | EXPLAIN (ANALYZE) | |||||
Time series | SHOW SERIES | DROP SERIES | DROP SERIES | ||||
Continuous query | CREATE CONTINUOUS QUERY | DROP CONTINUOUS QUERY | SHOW CONTINUOUS QUERIES | ||||
Measurement | SHOW MEASUREMENTS | SHOW MEASUREMENT (EXACT) CARDINALITY | |||||
Retention policy | SHOW RETENTION POLICIES | DROP RETENTION POLICY |