Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  How-Tos  >  Learn how to Backup or Export the Database from SSH
Top Scroll

Learn how to Backup or Export the Database from SSH

 2 min

Today we will see how you can export the database from SSH. This can be useful in situations like moving your site, as it can help you to export the entire database, or need to upgrade a website.

Generate a Database Backup:

Step 1: Connect to your server via SSH.

Step 2: In the command line enter the following code:

mysqldump -u dbusername -p databasename > nameofdbbackup.sql

Make sure you replace:

dbusername = with the database username for the database you want to export.

databasename = with the name of the database you want to export.

nameofdbbackup = enter a name for the exported database.

Step 3: Once you Press the Enter key, it will ask you for your password. Provide your password and press Enter key again, the exporting process will begin. It may take some time to complete the process, depending on the size of your database. The SSH client will take you to the new line when this process is completed and the database will now be available for download in your home directory.

Related: How To Login to Your Server By SSH?

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.