MariaDB Client

Overview

MariaDB Client can connect to MariaDB SkySQL services:

  • 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:

  • Distributed Transactions

  • Multi-Node Analytics

  • Replicated Transactions

  • Single Node Analytics

  • Single Node Transactions

Installation

Installation of MariaDB Client varies by operating system.

CentOS/RHEL

  1. Configure YUM package repositories:

    $ sudo yum install wget
    
    $ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    
    $ echo "b9e90cde27affc2a44f9fc60e302ccfcacf71f4ae02071f30d570e6048c28597 mariadb_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_repo_setup
    
    $ sudo ./mariadb_repo_setup \
       --mariadb-server-version="mariadb-10.6"
    
  2. Install MariaDB Client and package dependencies:

    $ sudo yum install MariaDB-client
    

Debian/Ubuntu

  1. Configure APT package repositories:

    $ sudo apt install wget
    
    $ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    
    $ echo "b9e90cde27affc2a44f9fc60e302ccfcacf71f4ae02071f30d570e6048c28597 mariadb_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_repo_setup
    
    $ sudo ./mariadb_repo_setup \
       --mariadb-server-version="mariadb-10.6"
    
    $ sudo apt update
    
  2. Install MariaDB Client and package dependencies:

    $ sudo apt install mariadb-client
    

SLES

  1. Configure ZYpp package repositories:

    $ sudo zypper install wget
    
    $ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
    
    $ echo "b9e90cde27affc2a44f9fc60e302ccfcacf71f4ae02071f30d570e6048c28597 mariadb_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_repo_setup
    
    $ sudo ./mariadb_repo_setup \
       --mariadb-server-version="mariadb-10.6"
    
  2. Install MariaDB Client and package dependencies:

    $ 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 "MS Windows (64-bit)".

  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 SkySQL service.

  2. Download the certificate authority chain.

  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 Fully Qualified Domain Name of your service.

    • Replace TCP_PORT with the read-write or read-only port of your service.

    • Replace DATABASE_USER with the default username for your service, or the username you created.

    • 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 a password. Enter the default password for your default user, the password you set for the default user, or the password for the database user you created.

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 SkySQL service.

  3. Download the certificate authority chain.

  4. 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 Fully Qualified Domain Name of your service.

    • Replace TCP_PORT with the read-write or read-only port of your service.

    • Replace DATABASE_USER with the default username for your service, or the username you created.

    • Replace PATH_TO_PEM_FILE with the path to the certificate authority chain (.pem) file.

  5. After the command is executed, you will be prompted for a password. Enter the default password for your default user, the password you set for the default user, or the password for the database user you created.

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