MariaDB Client

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

MariaDB Client can be used with:

  • MariaDB Platform for Transactions

  • MariaDB Platform for Analytics

  • MariaDB Platform for Smart Transactions

  • MariaDB Platform for Scale-Out Transactions

MariaDB Client installation and connection instructions follow. Additional information on MariaDB Client can be found in the MariaDB Enterprise Documentation reference.

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 "2de6253842f230bc554d3f5ab0c0dbf717caffbf45ae6893740707961c8407b7 mariadb_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_repo_setup
    
    $ sudo ./mariadb_repo_setup \
       --mariadb-server-version="mariadb-10.4"
    
  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 "2de6253842f230bc554d3f5ab0c0dbf717caffbf45ae6893740707961c8407b7 mariadb_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_repo_setup
    
    $ sudo ./mariadb_repo_setup \
       --mariadb-server-version="mariadb-10.4"
    
    $ 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 "2de6253842f230bc554d3f5ab0c0dbf717caffbf45ae6893740707961c8407b7 mariadb_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_repo_setup
    
    $ sudo ./mariadb_repo_setup \
       --mariadb-server-version="mariadb-10.4"
    
  2. Install MariaDB Client and package dependencies:

    $ sudo zypper install MariaDB-client
    

Installing MariaDB Client via MSI (Windows)

  1. Go to the MariaDB download page:

  2. In the "Version" drop-down, select the version that 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 when connecting to a database service you must specify the correct port.

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

    With MariaDB Client 10.4 and later, use the mariadb command:

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

    For MariaDB Client 10.3 and older, use the legacy command:

    $ mysql --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, it will prompt you for a 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.4\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 when connecting to a database service you must specify the correct port.

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

    With MariaDB Client 10.4 and later, use the mariadb command:

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

    For MariaDB Client 10.3 and older, use the legacy command:

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

    After the command is executed, it will prompt you for a password.