Get a free website with any plan

See how
CPANEL

Exporting and importing a database over SSH

Last updated

IN SHORT

To export and import large databases on Flashcloud, use mysqldump and mysql over SSH. This method runs directly on the server without file size limits, PHP restrictions, or browser timeouts. It works best for databases too large for phpMyAdmin, using gzip to compress dumps and zcat to import compressed files directly.

Export with mysqldump and import with mysql, both run over SSH. Neither command has a file size limit or a timeout, so this is a good option for databases that are too big for phpMyAdmin, or for anyone who prefers the command line.

This requires SSH access on your plan. If you don't have it, see importing and exporting large databases for the phpMyAdmin-only route, including how to raise upload and timeout limits for medium-sized files.

Exporting a database

Connect over SSH and run:

mysqldump -u dbuser -p dbname > dbname.sql

You'll be prompted for the database user's password. dbuser and dbname should match what's set up in MySQL Databases in the portal, or under phpMyAdmin / Manage My Databases in cPanel.

For anything over a few hundred MB, compress the output as it's written rather than dumping first and compressing after:

mysqldump -u dbuser -p dbname | gzip > dbname.sql.gz

This keeps disk usage down during the export and produces a smaller file to move around afterward.

Exporting specific tables

If you only need part of a database, list the tables after the database name:

mysqldump -u dbuser -p dbname table1 table2 > partial.sql

This is useful for pulling a single WordPress table like wp_options without dumping everything.

Moving the file

Once you have dbname.sql or dbname.sql.gz, transfer it with scp, rsync, or FTP if you'd rather use a client. If you're moving the file to another Flashcloud account or server rather than downloading it locally, scp straight between hosts avoids an extra download/upload round trip:

scp dbname.sql.gz user@destination-host:~/

Importing a database

Create an empty database and a database user first, if they don't already exist, then assign the user to it. In the portal this is done from the MySQL Databases tile; in cPanel, use the Database Wizard or phpMyAdmin.

Import with:

mysql -u dbuser -p dbname < dbname.sql

For a gzipped file, pipe it through zcat instead of decompressing it to disk first:

zcat dbname.sql.gz | mysql -u dbuser -p dbname

Both run entirely on the server. There's no upload step, no PHP limit involved, and no risk of a browser tab timing out midway through.

Checking the import worked

Log into mysql and check row counts on a couple of key tables, or open phpMyAdmin with its one-click login on your hosting service and browse the tables directly. For WordPress sites, also confirm the wp_options table's siteurl and home values match the domain you're importing into, since a mismatched URL is the most common cause of a "successful" import that still shows a broken site.

If the connection drops mid-transfer

A long-running import over an unstable SSH session can get cut off. Run it inside screen or tmux so the process keeps running even if your terminal disconnects:

screen -S import
zcat dbname.sql.gz | mysql -u dbuser -p dbname

Detach with Ctrl+A then D, and reattach later with screen -r import to check progress or confirm it finished.

When to contact support

If SSH access isn't showing up on your plan, or an import fails with a permissions or connection error you can't resolve, open a ticket from Support in the portal. It goes to a real person, not a bot, so include the exact error and what you were running when it happened.

Common questions

How do I import a database that is too large for phpMyAdmin?

Use SSH to run the mysql command directly on the server. This bypasses browser timeouts, upload limits, and PHP restrictions entirely. You can pipe compressed .sql.gz files straight into the database using zcat.

What happens if my SSH connection drops during an import?

The import will get cut off unless you run it inside screen or tmux. Start screen with a session name before running the import so the process continues on the server if your terminal disconnects.

Why does my WordPress site look broken after importing the database?

Your database likely has mismatched domain URLs. Open the wp_options table and confirm the siteurl and home values match the domain you imported into.

Do I need to create a database before importing the SQL file?

Yes, create an empty database and database user first. You can set them up in the Flashcloud portal under MySQL Databases or through cPanel, then assign the user to that database before running the import.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.