mariadb-dump

Generates SQL dumps of MariaDB schemas and data with correct client flags.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Generated mariadb-dump commands often miss MariaDB-specific defaults, producing backups that silently omit stored routines, block live writers, or fail on re-import. This Skill encodes the correct flags and traps so dump and restore commands work the first time. ## Core Features & Use Cases - Correct flag selection: Covers --single-transaction for live InnoDB snapshots, --routines/--events (off by default), --extended-insert vs diffable dumps, and schema-only/data-only modes. - Idempotent seeding and fixtures: Explains --replace/--insert-ignore for re-runnable seeds and --skip-extended-insert with --complete-insert for version-control-friendly fixtures. - Restore and replication guidance: Clarifies that dumps are restored by piping into the mariadb client, and that replication coordinates use --master-data/--dump-slave (not --source-data/--dump-replica). - Use Case: When asked to back up a live production database, produce mariadb-dump --single-transaction --routines --events appdb > dump.sql instead of a locking default dump missing procedures. ## Quick Start Ask the AI to write a mariadb-dump command that creates a consistent backup of your live database including stored procedures and events.

Frequently Asked Questions about mariadb-dump

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

FAQPage Schema
How do I dump a live MariaDB database without locking tables?▼

Use mariadb-dump with --single-transaction, which takes a consistent InnoDB snapshot via START TRANSACTION WITH CONSISTENT SNAPSHOT without blocking writers. Note that only InnoDB tables are consistent, and DDL on dumped tables during the dump breaks it.

Why is my mariadb-dump output missing stored procedures?▼

The --routines (-R) and --events (-E) flags are off by default in mariadb-dump, so procedures, functions, and events are omitted unless explicitly added. Triggers are included by default.

How do I restore a mariadb-dump SQL file?▼

Restore by piping the dump into the mariadb client: mariadb dbname < dump.sql. mariadb-dump only produces dumps and never loads them.

Does mariadb-dump support --source-data or --dump-replica flags?▼

No, those names do not exist in MariaDB. Use --master-data[=1|2] or --dump-slave[=1|2] to capture replication coordinates, optionally with --gtid for GTID positions.

How do I make a MariaDB dump re-importable without duplicate key errors?▼

Use --replace to emit REPLACE INTO statements or --insert-ignore to emit INSERT IGNORE, making re-seeding idempotent. Both are off by default.

Why does mariadb-dump dbname not include CREATE DATABASE?▼

A plain database name emits neither CREATE DATABASE nor USE statements. Use --databases dbname (-B) or --all-databases (-A) to include them in the output.