1. Home
  2. Hosting
  3. How to Export a MySQL Database via SSH with 1-grid

How to Export a MySQL Database via SSH with 1-grid

Back up large MySQL databases quickly and reliably using secure command-line tools without browser timeouts.

If you need to create a backup of your MySQL database, you can use SSH to export the database directly from your hosting environment on your 1-grid Client Portal account. This is especially useful for larger databases where browser-based tools like How to Access phpMyAdmin may experience processing or timeout limits. This guide shows you how to connect via SSH Access, create a mysqldump backup, compress the file, and download it safely.

How to Export a MySQL Database via SSH with 1-grid


Before You Begin

Before exporting your database via SSH, make sure you have:

  • Access to your 1-grid Customer Zone
  • An active hosting account with SSH access enabled
  • Your exact database name, username, and password (see How to Create a MySQL Database and How to Create a Database User)
  • Enough storage space on your server for the backup file and a secure location to download it to

💡 Tip: If you’re unsure which database belongs to your platform, check your website’s configuration files before running commands.


Follow These Steps

1. Open Your Hosting Service

Log in to your 1-grid Customer Zone and open the hosting service associated with the database you want to export. Confirm that SSH access is available. If SSH isn’t available, use How to Access phpMyAdmin instead.

2. Connect Using SSH

Use an SSH client (such as PuTTY on Windows, or Terminal on macOS and Linux) to connect to your hosting account using your SSH credentials.

3. Export Your MySQL Database

Once connected through SSH, run the following command:

bash

mysqldump -u database_username -p database_name > backup.sql

Use code with caution.

(Replace database_username and database_name with your actual database details. Enter your database password when prompted. Never put your password directly in the command string).

4. Wait for the Export to Complete

Larger databases may take several minutes to process. Allow the command to finish completely and return to the prompt without errors before closing your session.

5. Compress the Backup (Optional)

If your generated .sql backup file is large, compress it to save space and speed up transfers by running:

bash

gzip backup.sql

Use code with caution.

This creates a compressed backup.sql.gz archive.

6. Download Your Backup

Download your backup using SFTP, FTP, or File Manager. Store the file safely on your local device or an external location.

7. Verify Your Backup

Confirm that the backup file exists, has a realistic file size, and downloads successfully before deleting anything from the server.


What Happens Next?

Exporting creates a copy of your database without interrupting your live website. Note that database exports contain database information only; they do not include website files or images. For a complete migration, make sure you How to Back Up Website Files separately.


Keep Your Backups Safe

  • Maintain multiple backup versions outside of your hosting server environment.
  • Always generate a fresh backup before performing major site updates or software upgrades.

If This Didn’t Work

If mysqldump returns an error, verify that your database name and credentials are correct, your user has proper permissions, and your server has available disk space. Should issues persist, contact support with the exact error message and command used (excluding passwords).


You’re Ready!

You have successfully exported your MySQL database via SSH. Keep your downloaded copy secure and verified for future deployment needs.



Need Help?

If you’re unable to complete your database export or encounter an unexpected error, contact us. Our Support team is here to help. Have your domain name, database name, and the command used (without your password) ready.


Updated on August 17, 2026

Was this article helpful?

Related Articles