teamday-ai/agents/mysql

Claude Code and agent skill by teamday-ai/agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Query and manage MySQL databases using mysql CLI. Connect to PlanetScale, AWS RDS, Google Cloud SQL, or any MySQL instance.

Install

npx vskill@latest install teamday-ai/agents/mysql

SKILL.md

MySQL Skill

Query and manage MySQL databases using the mysql CLI.

Quick Start

bash
# Using individual variables
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "SELECT count(*) FROM users"

Prerequisites

Configure credentials as Space environment variables.

VariableDescriptionExample
MYSQL_HOSTDatabase hostdb.example.com
MYSQL_USERDatabase userreadonly
MYSQL_PASSWORDDatabase passwordsecret123
MYSQL_DATABASEDatabase namemyapp
MYSQL_PORTPort (optional, default 3306)3306

Or use a URL and parse it:

VariableDescriptionExample
MYSQL_URLFull connection URLmysql://user:pass@host:3306/dbname
Parse MYSQL_URL Helper
bash
if [ -n "$MYSQL_URL" ]; then
MYSQL_USER=$(echo "$MYSQL_URL" | sed -E 's|mysql://([^:]+):.*|\1|')
MYSQL_PASSWORD=$(echo "$MYSQL_URL" | sed -E 's|mysql://[^:]+:([^@]+)@.*|\1|')
MYSQL_HOST=$(echo "$MYSQL_URL" | sed -E 's|mysql://[^@]+@([^:/]+).*|\1|')
MYSQL_PORT=$(echo "$MYSQL_URL" | sed -E 's|mysql://[^@]+@[^:]+:([0-9]+).*|\1|')
MYSQL_DATABASE=$(echo "$MYSQL_URL" | sed -E 's|mysql://[^/]+/([^?]+).*|\1|')
MYSQL_PORT="${MYSQL_PORT:-3306}"
fi
Verify Connection
bash
mysql -h "$MYSQL_HOST" -P "${MYSQL_PORT:-3306}" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "SELECT version()"

Core Recipes

Run a Query
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "SELECT * FROM users LIMIT 10"
List Tables
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "SHOW TABLES"
Describe Table
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "DESCRIBE users"
Show Table Sizes
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "
SELECT table_name,
ROUND(data_length/1024/1024, 2) AS data_mb,
ROUND(index_length/1024/1024, 2) AS index_mb,
table_rows
FROM information_schema.tables
WHERE table_schema = '$MYSQL_DATABASE'
ORDER BY data_length DESC"
Count Rows
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "SELECT count(*) FROM users"

Export & Import

Export to CSV
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -B -e "SELECT * FROM users" | tr '\t' ',' > users.csv
Export as JSON (MySQL 8+)
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -N -e "
SELECT JSON_ARRAYAGG(JSON_OBJECT('id', id, 'email', email, 'name', name))
FROM users LIMIT 100" > users.json
Import SQL Dump
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" < dump.sql
Import CSV (via LOAD DATA LOCAL)
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" --local-infile -e "
LOAD DATA LOCAL INFILE 'data.csv' INTO TABLE users
FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS (name, email)"

Schema Operations

Show Create Table
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "SHOW CREATE TABLE users\G"
List Indexes
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "SHOW INDEX FROM users"
Show All Databases
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" -e "SHOW DATABASES"

Write Operations

Insert
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "INSERT INTO users (name, email) VALUES ('John', 'john@example.com')"
Update
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "UPDATE users SET name = 'Jane' WHERE id = 1"
Delete
bash
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE" -e "DELETE FROM users WHERE id = 1"

Managed Service Setup

PlanetScale
  • Host: aws.connect.psdb.cloud
  • Requires --ssl-mode=VERIFY_IDENTITY --ssl-ca=/etc/ssl/certs/ca-certificates.crt
  • Get credentials: PlanetScale Dashboard — Database — Connect — Create password
AWS RDS
  • Host: [instance].[region].rds.amazonaws.com
  • Default port: 3306
  • Add --ssl-mode=REQUIRED for encrypted connections
Google Cloud SQL
  • Use Cloud SQL Proxy or authorized networks
  • Host: Public IP from Cloud Console
Self-Hosted
  • Use host IP/domain, standard port 3306

Error Handling

ErrorCauseSolution
Can't connect to MySQL serverHost unreachableCheck MYSQL_HOST, firewall rules
Access deniedWrong credentialsVerify MYSQL_USER/MYSQL_PASSWORD
Unknown databaseDatabase doesn't existCheck MYSQL_DATABASE name
SSL connection errorSSL requiredAdd --ssl-mode=REQUIRED flag
Table doesn't existWrong table nameRun SHOW TABLES first

Tips

  • Always use `LIMIT` when exploring — avoid dumping entire tables
  • Use `-e` flag for single queries, pipe from files for multi-statement SQL
  • Use `\G` suffix instead of ; for vertical display of wide rows
  • Use `-B` flag for batch mode (tab-separated, no table borders) — good for scripting
  • Use `-N` flag to suppress column headers
  • Quote passwords with -p"$MYSQL_PASSWORD" (no space after -p)
  • SSL: Most cloud providers require SSL — add --ssl-mode=REQUIRED

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/teamday-ai/agents/mysql/badge)](https://verified-skill.com/skills/teamday-ai/agents/mysql)

Something wrong with this skill or its page? Tell us.