How do i make a backup dump file of a mysql database via ssh command line?

If you want to make a backup file of a specific mysql database via the ssh shell command line, for example if it's too large to backup via phpmyadmin tool. Here's the command to do that.

First off, you will need to be logged into your dedicated server or vps (virtual private server) via SSH. Once you are logged into the ssh command line terminal, issue this command as follows:

mysqldump db_name > db_backup.sql

db_name would be the name of the database for which you want to make the backup for. For example: john_xcartdb 

db_backup.sql is the backup file name you wish to make the dump backup to. This will create the dump file in the present directory you are in. For example, if you just login to your server via ssh, and issue the dump command above. It will create this dump file in: /root/db_backup.sql


reviewed: 10/24/2016

  • Email, SSL
  • 14 Users Found This Useful
Was this answer helpful?

Related Articles

How do I find my root password?

1) Log into your billing account: 2) Click on the...

How to generate a CSR in WHM

You would like to purchase or transfer an SSL certificate but need a CSR to do so. Here's how to...

Changing ip addresses

To move an account from one ip to another in WHM:1) Log into WHM using root login details....

-DELETE How to downgrade MySQL from Version 5 to Version 4

If you've upgraded your MySQL Software to the newest version but for whatever reason need to...

How to disable Recursive DNS Lookups

A very common PCI Issue is related to the DNS servers.  In order to be PCI Compliant you must...