This page covers the desktop-client workflow for moving dump files in and out of a MySQL, MariaDB, or Percona database on Stack Harbor PaaS. The walk-through uses MySQL Workbench as the example client; the same procedure works with DBeaver, TablePlus, Sequel Pro, and any other desktop client that supports JDBC.
For automated, scheduled backups, see Database backups. For a small ad-hoc dump or restore from inside the dashboard, phpMyAdmin’s Import and Export tabs work too — both are covered briefly at the end of this page.
Prerequisite — public IP
A desktop client outside the platform needs a network path to the database container. Attach a public IP to the database node (from the dashboard, click the Settings gear, then Public IPs, then Add). The platform issues an IPv4 address; use that as the host in the desktop client.
If your security policy does not allow a public IP on the database, set up an SSH tunnel through the application node instead, and connect the desktop client through the tunnel.
Import a dump
1. Create a server instance in MySQL Workbench
In Workbench, click Database → Manage Connections → New. Set:
- Hostname — the public IP of the database container.
- Port —
3306(the engine default). - Username and Password — from the create-time email.
Test the connection. Workbench may take a couple of minutes to validate.
2. Pick the remote management type
Workbench asks how it should reach the host for remote management (logs, configuration). For Stack Harbor PaaS, pick Standard TCP/IP — the platform’s database container does not expose the OS-level management endpoints Workbench expects for the other options.
3. Name and create
Set a name for the connection (e.g. prod-db-stackharbor) and finish. The connection is now available in Workbench’s start screen.
4. Import the dump
Open the connection. In the navigation pane, pick Data Import/Restore, then Import from Self-Contained File, point at the dump file, and click Start Import.
The import time depends on the dump size. A 100 MB dump usually completes in seconds; a multi-GB dump takes minutes.
5. Verify in phpMyAdmin
Back in the Stack Harbor dashboard, click Open in Browser on the database node to open phpMyAdmin. Sign in with the credentials from the create-time email. The imported schema should appear in the database list.
Export a dump
In the same Workbench connection, pick Data Export in the navigation pane. Tick the databases (or schemas, or tables) to export, set the output directory, and click Start Export.
Workbench writes the dump to the chosen directory. For a large database, expect the export to take minutes.
phpMyAdmin alternative
For dumps under a few hundred MB, phpMyAdmin’s built-in Import and Export tabs work from the dashboard without a desktop client:
- Export — open phpMyAdmin, pick the database in the left pane, click Export, choose Quick or Custom, click Go. The dump downloads to the browser.
- Import — pick the target database, click Import, Browse your computer, select the file, click Go.
The PHP upload limit caps how large a dump phpMyAdmin can accept directly. For larger dumps, use a desktop client or mysqldump over SSH.
mysqldump from the command line
For scripted exports, use mysqldump against the public IP. The command shape:
mysqldump -h {public_ip} -P 3306 -u {user} -p {dbname} > dump.sql
This writes the dump to the local filesystem. Pair it with gzip for storage:
mysqldump -h {public_ip} -P 3306 -u {user} -p {dbname} | gzip > dump.sql.gz
To restore from a mysqldump file:
mysql -h {public_ip} -P 3306 -u {user} -p {dbname} < dump.sql
See also
- Database backups — scheduled backups via the default backup script.
- MySQL connection — driver-level connection from applications.
- Database connection strings — host options including public IP.