database_import
Import a SQL dump file into a database via SSH. The dump executes directly, overwriting data as specified in the file.
Instructions
Load a .sql dump file (already present on the host) INTO a database via SSH (mysql). DESTRUCTIVE: the SQL runs as-is, so a dump containing DROP/CREATE will replace existing tables and data. The source file must live inside the staging dir (default /root/fastpanel-mcp-dumps, override with FASTPANEL_DUMP_DIR) — paths elsewhere are rejected, so scp the file there first (or produce it with database_dump). Targets the local MySQL via root socket auth. WRITE — set dry_run:true to preview the command, confirm:true to execute. Requires SSH configured (FASTPANEL_SSH_HOST).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | ||
| dry_run | No | ||
| database_id | Yes | Target database id from databases_list | |
| source_path | Yes | Absolute path to the .sql file, inside the staging dir |