-
Notifications
You must be signed in to change notification settings - Fork 0
MySQL Shell
Temp edited this page Dec 13, 2025
·
1 revision
MySQL Shell tools provide advanced data operations using MySQL Shell 8.0+.
- MySQL Shell 8.0+ installed
- MySQL Shell binary accessible (in PATH or via environment variable)
- Version Compatibility: MySQL Shell version should match or be newer than your MySQL Server version
⚠️ Version Mismatch: MySQL Shell 8.0.x has limited compatibility with MySQL Server 9.x. For best results, ensure your MySQL Shell version matches your server version.
| Tool | Description |
|---|---|
mysqlsh_version |
Get MySQL Shell version and installation status |
mysqlsh_check_upgrade |
Check server upgrade compatibility |
mysqlsh_export_table |
Export table to file (CSV, TSV, JSON) |
mysqlsh_import_table |
Parallel table import from file |
mysqlsh_import_json |
Import JSON documents to collection or table |
mysqlsh_dump_instance |
Dump entire MySQL instance |
mysqlsh_dump_schemas |
Dump selected schemas |
mysqlsh_dump_tables |
Dump specific tables |
mysqlsh_load_dump |
Load MySQL Shell dump |
mysqlsh_run_script |
Execute JS/Python/SQL script via MySQL Shell |
| Tool | Requirements |
|---|---|
mysqlsh_import_json |
Requires X Protocol (port 33060) for collection imports |
mysqlsh_load_dump |
Requires local_infile=ON in MySQL Server config |
mysqlsh_check_upgrade |
User needs RELOAD, PROCESS, SELECT privileges |
mysqlsh_dump_* / mysqlsh_load_dump
|
Shell version should match server version |
mysqlsh --version
# Expected: mysqlsh Ver 8.0.x for ...SET GLOBAL local_infile = 1;Or add to my.cnf:
[mysqld]
local_infile=ONmysqlsh --uri root@localhost:33060 --sql -e "SELECT 1"| Variable | Default | Description |
|---|---|---|
MYSQLSH_PATH |
mysqlsh |
Path to MySQL Shell binary |
MYSQLSH_WORK_DIR |
Current directory | Working directory for dump/load operations |
MYSQLSH_TIMEOUT |
300000 |
Command timeout in milliseconds (5 min) |
⚠️ MySQL Shell commands execute as subprocesses. Ensure proper file system permissions for dump/load operations.
{
"mcpServers": {
"mysql-mcp": {
"command": "node",
"args": [
"C:/path/to/mysql-mcp/dist/cli.js",
"--transport", "stdio",
"--mysql", "mysql://user:password@localhost:3306/database"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "production",
"MYSQLSH_PATH": "mysqlsh"
}
}
}
}If you only want MySQL Shell tools (e.g., for a dedicated backup/migration agent):
{
"args": [
"--transport", "stdio",
"--mysql", "mysql://user:password@localhost:3306/database",
"--tool-filter", "-core,-json,-text,-fulltext,-performance,-optimization,-admin,-monitoring,-backup,-replication,-partitioning,-transactions,-router,-proxysql"
]
}This exposes only the 10 MySQL Shell management tools.
- Tool-Reference - Complete tool list
- Tool-Filtering - Custom tool filtering
- Configuration - General configuration
mysql-mcp • v1.0.0 • MIT License
mysql-mcp Wiki
Getting Started
Tools
Advanced Topics
Links