Help Center/ GaussDB(DWS)/ Management Guide/ SQL Editor Development Tool/ Using the SQL Editor to Connect to a Cluster
Updated on 2024-07-29 GMT+08:00

Using the SQL Editor to Connect to a Cluster

Data sources are used for cluster login. Currently, the GaussDB(DWS) cluster supports two login modes: custom (username + password) and IAM. Custom login is the default login mode. With IAM login, you create an IAM user in the database and use a token to log in.

  • IAM login is only supported by clusters of 8.1.3.331 (included) to 8.2.0 (excluded), 8.2.1.100, and later versions. For DWS 3.0 clusters, only clusters of 9.1.0 and later versions support IAM login.
  • In customized login mode, you can create a user on the cluster user management page and grant permissions to the user. For details, see Database User Management.

Constraints and Limitations

  • Custom login constraints:
    • Select a cluster for the new data source, enter the username and password, and test the connection. After the connection is tested, you can open the cluster data connection.
    • You are advised to select Remember password during login. If the database is not specified, the GaussDB database is used by default.
    • Depending on tenants and users, connection permissions are separated. Connections are visible to different sub-users. Only the creator of a connection can view it.
  • IAM login constraints:
    • Only IAM sub-users who have been assigned the DWS Database Access role can log in to GaussDB(DWS) clusters. In this case, you need to contact a user with the DWS Administrator permissions to grant you the role on the current page.
    • After logging in to the database, IAM sub-users have only the query permissions and do not have the operation permissions. To perform operations, IAM users need to be granted related permissions.
  • Connection timeout limit:
    • The connection timeout period is set in the background. If no operation is performed within 30 minutes, you need to log in again.
    • The connection uniquely caches the user login ID and database name to guarantee that each user connects to each database with one connection and performs each operation on one connection.

Procedure

  1. Log in to the GaussDB(DWS) console.
  2. In the navigation tree, choose Data > SQL Editor.
  3. There are two panels on the left: Data Warehouse and Custom. Data Warehouse can only be logged in by IAM users with the DWS Database Access role. If the conditions are met, you can connect to a cluster database to perform operations.
  4. Switch to the Custom panel and click Add Data Source. (Alternatively, access the Dedicate Cluster page, locate the row that contains the target cluster, and click Login in the Operation column.)

    • Cluster: Select the cluster to be connected.
    • Database: Enter the database name. For a newly created cluster, enter the default database gaussdb or switch to another database as required.
    • Data Source: Set the data source name.
    • Username: Set the username.
    • Password: Set the password of the user. This password is used only to create data sources and data source connections for the WEB-SQL editor. If Remember password is selected, the default password is used for login when the data source is opened. If Remember password is not selected, the password needs to be entered again when the data source is opened after the page is refreshed or the login expires.

  5. Confirm the information and click Test Connection.