MariaDB Client

MariaDB Client is a command-line tool for interacting with MariaDB Servers, including MariaDB database services on MariaDB SkySQL.

For additional information, see command-line options for mariadb and mysql.

Compatibility

MariaDB Client can be used with:

  • MariaDB Platform for Transactions

  • MariaDB Platform for Analytics

  • MariaDB Platform for Smart Transactions (HTAP)

  • MariaDB Platform for Distributed SQL

Installing MariaDB Client

Installation of MariaDB Client varies by operating system.

Installing MariaDB Client via YUM (RHEL/CentOS)

  1. Configure YUM package repositories:

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

    $ sudo yum install MariaDB-client
    

Installing MariaDB Client via APT (Debian/Ubuntu)

  1. Configure APT package repositories:

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

    $ sudo apt install mariadb-client
    

Installing MariaDB Client via ZYpp (SLES)

  1. Configure ZYpp package repositories:

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

    $ sudo zypper install MariaDB-client
    

Installing MariaDB Client via MSI (Windows)

  1. Go to the MariaDB Enterprise section / MariaDB Community Server tab of the MariaDB download page:

  2. In the "Version" drop-down, select the version you want to download.

  3. In the "OS" drop-down, 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".

Connecting with MariaDB Client

MariaDB Client command-line parameters vary by operating system.

Connecting with MariaDB Client on Linux

  1. Determine the connection information for your MariaDB SkySQL database service:

    Parameter

    Where to find it

    --host

    Fully Qualified Domain Name in the Service Details view

    --port

    Read-Write Port or Read-Only Port in the Service Details view

    skysql_chain.pem file

    Download

    --user

    Default username in the Service Credentials view, or the username you created

    Password

    Default password in the Service Credentials view, the password you set on the default user, or the password for the user you created

    Note

    MariaDB SkySQL does not use the standard port for client connections, so you must specify the correct port when connecting to a database service.

  2. Use MariaDB Client with the connection information to connect to your MariaDB SkySQL database service:

    $ mariadb --host example.skysql.net --port 5001 \
          --user db_user --password \
          --ssl-verify-server-cert \
          --ssl-ca ~/Downloads/skysql_chain.pem
    

    After the command is executed, you will be prompted for the password.

Connecting with MariaDB Client on 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.5\bin;%PATH%"
    
  2. Determine the connection information for your MariaDB SkySQL database service:

    Parameter

    Where to find it

    --host

    Fully Qualified Domain Name in the Service Details view

    --port

    Read-Write Port or Read-Only Port in the Service Details view

    skysql_chain.pem file

    Download

    --user

    Default username in the Service Credentials view, or the username you created

    Password

    Default password in the Service Credentials view, the password you set on the default user, or the password for the user you created

    Note

    MariaDB SkySQL does not use the standard port for client connections, so you must specify the correct port when connecting to a database service.

  3. Use MariaDB Client with the connection information to connect to your MariaDB SkySQL database service:

    $ mariadb --host example.skysql.net --port 5001 \
          --user db_user --password \
          --ssl-verify-server-cert \
          --ssl-ca skysql_chain.pem
    

    After the command is executed, you will be prompted for the password.

Client 10.3 and Older

With MariaDB Client 10.4 and later, use the mariadb command as documented above.

For MariaDB Client 10.3 and older, use the legacy mysql command.

On Linux:

$ mysql --host example.skysql.net --port 5001 \
      --user db_user --password \
      --ssl-verify-server-cert \
      --ssl-ca ~/Downloads/skysql_chain.pem

On Windows:

$ mysql --host example.skysql.net --port 5001 \
      --user db_user --password \
      --ssl-verify-server-cert \
      --ssl-ca skysql_chain.pem