Help Center/ GaussDB/ User Guide/ GaussDB Instance Connection/ Using DBeaver to Connect to an Instance
Updated on 2024-11-13 GMT+08:00

Using DBeaver to Connect to an Instance

DBeaver is a multi-platform database client for you to connect to different databases using particular drivers. This section describes how to use DBeaver to connect to a GaussDB instance.

This section uses DBeaver 24.1.4 as an example. DBeaver's GUIs differ depending on the version you are using. To learn more about how to perform operations in different versions, refer to the product documentation specific to that version.

Step 1: Obtain the DBeaver Client Installation Package

The DBeaver official website provides client installation packages for different OSs. Download the required DBeaver client installation package, and install it on the local PC.

Step 2: Connect to the Database

  1. On the DBeaver client, choose to create a connection.
  2. On the SQL tab, select GaussDB and click Next.
    Figure 1 Selecting a database

  3. Enter the host IP address, port number, database name, username, and password.
    Figure 2 Configuring the connection

    Table 1 Parameters

    Parameter

    Description

    Host

    Private IP address of the DB instance to be connected. To obtain the IP address, perform the following steps:
    1. Log in to the GaussDB management console.
    2. Select the region in which the target instance is located.
    3. Click the name of the target instance to enter the Basic Information page.
    4. In the Node List area, view the EIP of the instance.

      If no EIP is bound to the instance, bind one to the instance first. For details, see Binding an EIP.

    Port

    Port of your DB instance specified during instance creation. The default port of a GaussDB instance is 8000.

    Database

    Name of the database to be connected. After a DB instance is created, a database named postgres is generated by default.

    Username

    Name of the user who will access the GaussDB instance. The default user is root.

    Password

    Password of the user who will access the GaussDB instance.

  4. Click Test Connection. In the Driver settings dialog box, click Download to enable the server to automatically download driver files. If Connected is displayed in the dialog box, the connection is successful. Click OK.

    Alternatively, obtain driver files by yourself and click Edit Driver. Then, click the Libraries tab and add the local driver files to the driver editor.

    Figure 3 Automatically downloading driver files

    Figure 4 Manually adding local driver files

  5. Click Finish to connect to the database. You can view information about the connected database in the Database Navigator area.

Related Operations

  1. Obtain the driver package and its verification package.

    Download the driver package and its verification package of the relevant version to any local directory. Table 2 lists the download list.

  2. Verify the driver package.

    To prevent the driver package from being maliciously tampered during transfer or storage, perform the following steps to verify the driver package:

    1. Press Win+R to open the Run text box. Type cmd in the Open field and press Enter to open the Command Prompt window.
    2. Run the following command to obtain the hash value of the driver package:

      certutil -hashfile {Local directory of the driver package}\{Driver package name} sha256

      • Replace {Local directory of the driver package} with the actual download path, for example, C:\Users.
      • Replace {Driver package name} with the name of the downloaded driver package, for example, GaussDB_driver.zip.

      Example: certutil -hashfile C:\Users\GaussDB_driver.zip sha256

    3. Compare the hash value obtained in 2.b with the hash value of the verification package obtained in 1.
      • If they are consistent, the verification is successful.
      • If they are inconsistent, download the driver package again and repeat 2.a to 2.c to verify the driver package.
  3. Extract the gsjdbc4.jar package from the driver package.

    Decompress the driver package obtained in 1 to the local PC. Then, go to any OS directory in the directory of the driver package corresponding to the type of the instance to be connected, extract the gsjdbc4.jar package from the GaussDB-Kernel_Database version_OS version_64bit_Jdbc.tar.gz package, and save it to any local directory. The following is an example:

    To connect to a distributed instance, go to the GaussDB_driver\Distributed\Euler2.5_X86_64 directory, find the GaussDB-Kernel_503.1.0.SPC2300_Euler_64bit_Jdbc.tar.gz package, and extract the gsjdbc4.jar package from it.

    The same JDBC driver package is used across different operating systems and CPU architectures. You only need to focus on the instance type when obtaining the required gsjdbc4.jar package.