MariaDB Client

Overview

MariaDB Client can connect to MariaDB Enterprise:

  • Queries can be run interactively or from scripts

  • MariaDB Client is available for Linux and Windows

Compatibility

MariaDB Client (mariadb) has been tested by MariaDB to properly connect and execute queries with:

  • MariaDB Enterprise ColumnStore

  • MariaDB Enterprise Server

  • MariaDB MaxScale

  • MariaDB Xpand

Installation

Installation of MariaDB Client varies by operating system.

Linux (Repository)

  1. Configure a MariaDB repository.

    Before MariaDB Client can be installed on Linux, a MariaDB repository must be configured. MariaDB Corporation offers multiple repositories:

    For additional information on how to configure a MariaDB repository, see "Configure MariaDB Repository".

  2. Install MariaDB Client and package dependencies.

    Install on CentOS / RHEL / Rocky Linux (YUM):

    $ sudo yum install MariaDB-client
    

    Install on Debian / Ubuntu (APT):

    $ sudo apt install mariadb-client
    

    Install on SLES (ZYpp):

    $ sudo zypper install MariaDB-client
    

Windows

  1. Access MariaDB Downloads for MariaDB Community Server.

  2. In the "Version" dropdown, select the version you want to download.

  3. In the "OS" dropdown, select either "MS Windows (64-bit)" or "MS Windows (32-bit)", depending on whether you need a 64-bit or 32-bit client.

  4. Click the "Download" button to download the MSI package.

  5. When the MSI package finishes downloading, run it.

  6. On the first screen, click "Next" to start the Setup Wizard.

  7. On the second screen, click the license agreement checkbox, and then click "Next".

  8. On the third screen, select the components you want to install. If you only want the standard MariaDB Client tools:

    • Deselect "Database instance".

    • Deselect "Backup utilities".

    • Deselect "Development Components".

    • Deselect "Third party tools".

    • When only "Client programs" is selected, click "Next".

  9. On the next screen, click "Install".

  10. When the installation process completes, click "Finish".

Connect

Linux

  1. Determine the connection parameters for your MariaDB Enterprise database.

  2. Use your connection parameters in the following command line:

    $ mariadb --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
          --user DATABASE_USER --password \
          --ssl-verify-server-cert \
          --ssl-ca ~/PATH_TO_PEM_FILE
    
    • Replace FULLY_QUALIFIED_DOMAIN_NAME with the IP address or Fully Qualified Domain Name of your database.

    • Replace TCP_PORT with the TCP port of your database.

    • Replace DATABASE_USER with the username for your database user account.

    • If TLS is required, replace ~/PATH_TO_PEM_FILE with the path to the certificate authority chain (.pem) file.

  3. After the command is executed, you will be prompted for the password of your database user account.

Windows

  1. Fix your executable search path.

    On Windows, MariaDB Client is not typically found in the executable search path by default. You must find its installation path, and add that path to the executable search path:

    $ SET "PATH=C:\Program Files\MariaDB 10.6\bin;%PATH%"
    
  2. Determine the connection parameters for your MariaDB Enterprise database.

  3. Use your connection parameters in the following command line:

    $ mariadb --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
          --user DATABASE_USER --password \
          --ssl-verify-server-cert \
          --ssl-ca PATH_TO_PEM_FILE
    
    • Replace FULLY_QUALIFIED_DOMAIN_NAME with the IP address or Fully Qualified Domain Name of your database.

    • Replace TCP_PORT with the TCP port of your database.

    • Replace DATABASE_USER with the username for your database user account.

    • If TLS is required, replace PATH_TO_PEM_FILE with the path to the certificate authority chain (.pem) file.

  4. After the command is executed, you will be prompted for the password of your database user account.

Client 10.3 and Older

The instructions provided (above) for MariaDB Client 10.4 may be adapted for MariaDB Client 10.3 and older.

Modern versions of MariaDB Client use client binary filename of mariadb

For MariaDB Client 10.3 and older, the client binary filename was mysql rather than mariadb