Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Doris/ Using the MySQL Client to Connect to Doris
Updated on 2024-10-09 GMT+08:00

Using the MySQL Client to Connect to Doris

Doris supports the MySQL protocol. Therefore, most clients that support the MySQL protocol can access Doris, including the CLI or IDE, such as MariaDB, DBeaver, and Navicat for MySQL.

This section uses the MySQL 8.0.22 client to connect to Doris as an example.

Prerequisite

The node where the MySQL client is to be installed can communicate with the MRS cluster.

Procedure

  1. Log in to the node where the MySQL client is to be installed as the root user.
  2. Run the following command to check the version of the ncurses-libs library on which the MySQL client depends:

    rpm -qa | grep ncurses

  3. Download the software package corresponding to the MySQL client from https://downloads.mysql.com/archives/community/. You are advised to install MySQL 8.x. The following uses Red Hat as an example:

    • If the dependent library in 2 is 6.x, you are advised to download the MySQL software package whose OS version is Red Hat 8.
    • If the dependent library in 2 is 5.x, you are advised to download the MySQL software package whose OS version is Red Hat 7.

    For example, to install the MySQL 8.0.22 client of Red Hat, download the following software packages:

  4. Upload the downloaded software package to the node where the MySQL client is to be installed.
  5. Run the following command in the directory where the uploaded file is stored to install the MySQL client and the corresponding dependency package:

    rpm -ivh mysql-community-client-8.0.22-1.el8.x86_64.rpm --nodeps --force

    rpm -ivh mysql-community-client-plugins-8.0.22-1.el8.x86_64.rpm --nodeps --force

    rpm -ivh mysql-community-common-8.0.22-1.el8.x86_64.rpm --nodeps --force

    rpm -ivh mysql-community-libs-8.0.22-1.el8.x86_64.rpm --nodeps --force

  6. Run the following command to check the MySQL client version:

    mysql --version

  7. After the MySQL client is successfully installed, you can access Doris. For details, see Getting Started with Doris.