Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

MariaDB Client

$ mariadb Official High Risk
MariaDB Foundation · Database & Data · GPL-2.0 · macos / linux / windows

mariadb is the official command-line client for MariaDB (and MySQL-compatible servers), supporting headless queries via -e, tab-separated --batch --raw output, --xml, and --safe-updates. While reliable for scripting, it lacks a native --json output flag.

FCRS-1.0 Score
78 /100
Good
Medium Confidence
Zero-Friction Install
brew install mariadb
CLI vs MCP Decision CLI Preferred vs MCP

Direct mariadb -e --batch invocations avoid MCP overhead and preserve exact SQL semantics and streaming.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Predictable -e + --batch --raw non-interactive execution and --xml/--html modes, but lacks a native --json flag and opens an interactive prompt if -e/stdin is omitted.

  • --batch --raw outputs clean TSV without ASCII borders
  • No native --json output flag (relies on TSV, --xml, or JSON_OBJECT())
Trust & Safety 19 / 25

--safe-updates blocks unkeyed UPDATE/DELETE statements and --defaults-extra-file isolates credentials, though there is no client-side --readonly flag.

  • --safe-updates protects against accidental full-table updates/deletes
Setup & Portability 13 / 15

Available across macOS (brew), Linux packages, and Windows installers.

  • Standard distribution across OS package managers
Utility & Efficiency 13 / 15

Fast C client handling large SQL dumps, streaming queries, and JSON_OBJECT() queries.

  • Efficient streaming of large query results and SQL imports
Maintenance & Lineage 8 / 10

Official MariaDB Foundation client (MariaDB/server) under GPL-2.0.

  • First-party MariaDB Foundation repository
Docs & Verifiability 7 / 10

Well-documented MariaDB Knowledge Base page and detailed --help.

  • Official Knowledge Base reference

Security, Auth & Guardrails

Auth Modes
Config File Env API Key
Credential Storage

Reads credentials from ~/.my.cnf (--defaults-extra-file), MYSQL_PWD env var (discouraged), or Unix socket auth.

Side Effects
Read-Only Remote Write Destructive
Cost & Quotas

GPL-2.0 open-source MariaDB Foundation client; free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# MariaDB Client Agent Rules
- Always pass `-e "..." --batch --raw` so `mariadb` runs non-interactively without ASCII box borders.
- Enable `--safe-updates` on any non-read-only session and prefer a read-only DB user when inspecting schemas.
- Read credentials from `~/.my.cnf` or `--defaults-extra-file` rather than passing `-p<password>` on the command line.

Agent-Ready Command Recipes

Safe Read-Only Queries

List tables in clean batch TSV format
mariadb -h 127.0.0.1 -u readonly --batch --raw -e "SHOW TABLES;" app_db

Executes a single read-only SQL statement non-interactively with tab-separated output.

Inspect schema as XML
mariadb -h 127.0.0.1 -u readonly --xml -e "DESCRIBE users;" app_db

Returns structured XML describing table columns and types.

Controlled Writes & Previews

Run updates with safe-updates guard enabled
mariadb -h 127.0.0.1 -u appuser --safe-updates -e "UPDATE users SET active = 0 WHERE id = 42;" app_db

Enables --safe-updates (--i-am-a-dummy) so UPDATE/DELETE without WHERE keys or LIMIT are rejected.

Strengths for Agents

  • + --batch --raw strips ASCII table borders for clean TSV parsing.
  • + --safe-updates prevents catastrophic DELETE/UPDATE statements lacking WHERE key clauses.
  • + --defaults-extra-file keeps database passwords out of shell arguments.

Caveats & Pitfalls

  • ! No native --json CLI output flag; structured serialization requires --xml or SQL JSON_OBJECT().
  • ! Running without -e or piped stdin opens an interactive SQL prompt.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI