MariaDB Import for SkySQL Services

MariaDB Import is a command-line tool for importing data into MariaDB Servers, including MariaDB database services on MariaDB SkySQL.

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

Compatibility

MariaDB Import 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 Import

Installation of MariaDB Import varies by operating system.

Installing MariaDB Import 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 Import and package dependencies:

    $ sudo yum install MariaDB-client
    

Installing MariaDB Import 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 Import and package dependencies:

    $ sudo apt install mariadb-client
    

Installing MariaDB Import 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 Import and package dependencies:

    $ sudo zypper install MariaDB-client
    

Installing MariaDB Import 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 on 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".

Importing Data with MariaDB Import

MariaDB Import command-line parameters vary by operating system.

Importing Data with MariaDB Import 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 import the data from the TSV or CSV file into your MariaDB SkySQL database service:

    $ mariadb-import --host example.skysql.net --port 5001 \
          --user db_user --password \
          --ssl-verify-server-cert \
          --ssl-ca ~/Downloads/skysql_chain.pem \
          --local \
          --ignore-lines=1 \
          accounts contacts.tsv
    

    If your file is a CSV file, rather than a TSV file, you must also use the --fields-terminated-by=, option.

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

    MariaDB Import does the following:

    • Uses the first argument as the database name (in other words, accounts).

    • Uses the TSV or CSV file's basename without the extension as the table name (in other words, contacts).

Importing Data with MariaDB Import on Windows

  1. Fix your executable search path.

    On Windows, MariaDB Import 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 import the data from the TSV or CSV file into your MariaDB SkySQL database service:

    $ mariadb-import --host example.skysql.net --port 5001 \
          --user db_user --password \
          --ssl-verify-server-cert \
          --ssl-ca skysql_chain.pem \
          --local \
          --ignore-lines=1 \
          accounts contacts.tsv
    

    If your file is a CSV file, rather than a TSV file, you must also use the --fields-terminated-by=, option.

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

    MariaDB Import does the following:

    • Uses the first argument as the database name (in other words, accounts).

    • Uses the TSV or CSV file's basename without the extension as the table name (in other words, contacts).

MariaDB Import 10.3 and Older

With MariaDB Import 10.4 and later, use the mariadb-import command as documented above.

For MariaDB Import 10.3 and older, use the legacy mysqlimport command.

For Linux:

$ mysqlimport --host example.skysql.net --port 5001 \
      --user db_user --password \
      --ssl-verify-server-cert \
      --ssl-ca ~/Downloads/skysql_chain.pem \
      --local \
      --ignore-lines=1 \
      accounts contacts.tsv

For Windows:

$ mysqlimport --host example.skysql.net --port 5001 \
      --user db_user --password \
      --ssl-verify-server-cert \
      --ssl-ca skysql_chain.pem \
      --local \
      --ignore-lines=1 \
      accounts contacts.tsv