mariadb-import

Bulk-load text files into MariaDB tables using the mariadb-import client.

28|115|Updated Jan 28, 2025
One-click install
npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-import-mariadb-corporation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mariadb-import
Source: https://github.com/mariadb-corporation/mariadb-docs/tree/main/agent-skills/granular/tools/mariadb-import
Command: npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-import-mariadb-corporation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bulk-loading CSV or TSV files into MariaDB with mariadb-import trips up users because the tool derives table names from filenames, defaults to TAB-separated fields regardless of extension, and has subtle flag interactions like --replace versus --ignore and --parallel versus --lock-tables. ## Core Features & Use Cases - Correct invocation patterns: Explains the table-name-from-filename rule, the database-first argument order, and the --local versus server-side file reading fork. - Flag semantics and conflicts: Covers --replace/--ignore mutual exclusion, --columns versus --ignore-lines, --parallel disabling under --lock-tables, and locale-autodetected connection charset. - Use Case: You need to load a header-row CSV into table users in database mydb. The skill gives the exact command: mariadb-import --local --fields-terminated-by=, --fields-optionally-enclosed-by='"' --ignore-lines=1 mydb ./users.csv. ## Quick Start Ask the AI to write a mariadb-import command that loads a local comma-separated CSV file with a header row into a specific MariaDB table.

Frequently Asked Questions about mariadb-import

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import a CSV file into MariaDB with mariadb-import?▼

mariadb-import defaults to TAB-separated fields regardless of file extension, so for real CSV pass --fields-terminated-by=, and --fields-optionally-enclosed-by='"'. Add --ignore-lines=1 to skip a header row and --local so the client reads the file.

How does mariadb-import determine the target table name?▼

There is no table argument; the table name comes from the data file's base name minus directory and extension, so users.csv loads into table users. The first non-option argument is the database.

What is the difference between --replace and --ignore in mariadb-import?▼

--replace overwrites existing rows on duplicate keys while --ignore keeps the existing row, and the two flags are mutually exclusive. Combining them causes the tool to error and exit.

Why does mariadb-import not load files in parallel with --lock-tables?▼

The --lock-tables flag disables parallelism, so the threaded path from --parallel or --use-threads runs only when locking is off. Remove --lock-tables to get concurrent file loads.

Does mariadb-import read the file locally or on the server?▼

Without --local, the server reads the file, requiring the FILE privilege and secure_file_priv compliance. With --local or -L, the client reads it via LOAD DATA LOCAL INFILE, subject to local_infile being enabled.

What character set does mariadb-import use by default?▼

The default connection character set is auto-detected from the client locale, not a fixed latin1. Pass --default-character-set=utf8mb4 to make the encoding explicit.