Extract MySQL database content to text-readable formats (CSV, JSON, Markdown) for LLM processing and content synthesis. Use when working with MySQL databases that need to be converted to text formats for analysis, synthesis, or inclusion in LLM context windows. Routed from db-router skill.
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The canonical home for this skill is db-extractor-mysql in KennethJefferson/cc_sdk_knowledge_extractor
Extract MySQL database tables to text-readable formats for LLM-based content synthesis.
# Extract all tables to CSV (default)
python scripts/db_extract.py mysql://user:password@localhost:3306/mydb
# Extract to JSON
python scripts/db_extract.py mysql://user:password@localhost/mydb -f json
# Extract to Markdown (best for LLM context)
python scripts/db_extract.py mysql://root:secret@localhost/course_db -f markdown
# All formats with schema documentation
python scripts/db_extract.py mysql://user:pass@host/db -f all --schema -o ./outputmysql://[user[:password]@]host[:port]/databaseExamples:
mysql://root:password@localhost:3306/mydb - Full formatmysql://root@localhost/mydb - No password (prompts or uses empty)mysql://user:pass@db.example.com/production - Remote host| Format | Best For | File Extension |
|---|---|---|
| CSV | Data analysis, spreadsheets, pandas | .csv |
| JSON | Structured processing, APIs | .json |
| Markdown | LLM context, human reading | .md |
# Extract course DB with schema docs for context
python scripts/db_extract.py mysql://root:pass@localhost/course_db -f markdown --schema -o ./course_content# Only specific tables
python scripts/db_extract.py mysql://user:pass@host/db --tables users,posts,comments
# Exclude system tables
python scripts/db_extract.py mysql://user:pass@host/db --exclude migrations,logs# Limit markdown rows for large tables
python scripts/db_extract.py mysql://user:pass@host/db -f markdown --max-rows 50python scripts/db_extract.py CONNECTION [OPTIONS]
Arguments:
CONNECTION MySQL connection string: mysql://user:pass@host:port/database
Options:
-o, --output DIR Output directory (default: ./extracted)
-f, --format FORMAT csv|json|markdown|all (default: csv)
--tables TABLES Comma-separated table list
--exclude TABLES Tables to skip
--schema Include _schema.md documentation
--max-rows N Row limit for markdown (default: 100)
--charset CHARSET Character set (default: utf8mb4)
--timeout SECONDS Connection timeout (default: 30)
-q, --quiet Suppress progress outputoutput/
├── _schema.md # Schema documentation (if --schema)
├── csv/ # (if format=all)
│ ├── table1.csv
│ └── table2.csv
├── json/
│ └── ...
└── markdown/
└── ...Single format outputs files directly to output directory without subdirectories.
pip install mysql-connector-pythonThe following are automatically excluded from extraction:
mysqlinformation_schemaperformance_schemasysedc9701
Canonical home
since Nov 5, 2026
Also appears in
since Nov 5, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.