Create an account to connect to a MariaDB instance. This document describes how to create an account and modify its permissions through the TencentDB for MariaDB console.
Note
Currently, creating and modifying accounts through command lines such as insert into mysql.user, grant, and drop are not supported.
Create account
1. Log in to the TencentDB for MariaDB console. In the instance list, click an instance ID or Manage in the Operation column to enter the instance management page.
2. On the instance management page, select the Account Management tab and click Create Account.
3. In the pop-up window, enter the account name, host, password, and remarks. Click Confirm, Next.
Create as read-only account: Select Yes to indicate that the account can only use read requests (select).
Note
For the same account name with different host IPs, permissions need to be set independently. You can quickly clone similar accounts and set permissions using the Clone Account feature in Account Management.
Host: Can be understood as HOST, supporting IP, IP range, and % formats. The % symbol represents a wildcard. For example, to support all host IPs from 10.10.10.1 to 10.10.10.254, you can enter 10.10.10.%.
Connection Limit: MariaDB versions 5.7 and 8.0 support setting the maximum concurrent connection limit for an account during account creation. The maximum number of connections for an account is subject to the instance's maximum connection limit.
4. To set the account permission as Read-Only, you need to set the connection of the read-only account.
5. In the pop-up window, configure the database permissions and click Save Settings, or you can choose to Set Later.
Configure permissions
1. On the account management page, click Modify Permissions in the Operation column.
2. In the pop-up dialog, allocate permissions as needed and click Save Settings to complete the permission assignment. MariaDB permissions are object-level permissions, including 19 common database permissions. You can set permissions for objects such as tables, views, functions, and triggers.
Note
You need to create a database before setting the object-level permissions.