Backup through SSH?

Description of your first forum.
Post Reply
babitaacharya644
Posts: 7
Joined: Wed Jan 21, 2015 4:17 pm

Backup through SSH?

Post by babitaacharya644 » Thu Mar 05, 2015 4:25 pm

Hello To All , please help me

I've dedicated servers and I want to take my database back up through SSH.
My question is, How to take database backup on my dedicated server through SSH?

Chloeyoung
Posts: 10
Joined: Wed Jan 21, 2015 2:21 pm

Re: Backup through SSH?

Post by Chloeyoung » Tue Mar 24, 2015 3:56 pm

hello
Try this solutions

Login to your server using SSH and use one of the following commands:

mysqldump -u $mysqlusername -p$mysqlpassword $mysqldatabasename > backup.sql

With the above, be sure to replace $mysqlusername, $mysqlpassword and $mysqldatabasename with the appropriate user, pass and database you're backing up. backup.sql will be the name of the backup file.

kevinchristian381
Posts: 11
Joined: Thu Jan 22, 2015 4:33 pm

Re: Backup through SSH?

Post by kevinchristian381 » Thu Apr 02, 2015 8:59 am

Thanks to all,for this very helpful topic.
Thanks.

laurencecatherine741
Posts: 9
Joined: Wed Jan 21, 2015 4:11 pm

Re: Backup through SSH?

Post by laurencecatherine741 » Mon May 18, 2015 4:51 pm

Back Up Your MySQL Database Using SSH

Follow the steps below to backup your MySQL Database and store the backup in your server via SSH.

If your package does not have SSH access, then you will need to Backup Your Database Using phpMyAdmin.

Step 1
Before you start, you must set up an SSH Connection from Your PC

Step 2
Once logged in, type the pwd command and press ENTER to print working catalog (or more simply, to display which folder you are currently in). The entire folder structure will be displayed. In this article, the current working directory is a Dedicatedhosting4u subfolder of the server space.
(uiserver):u12345678:~/Dedicatedhosting4u > pwd
/kunden/homepages/11/d999999999/htdocs/Dedicatedhosting4u

Step 3
Type cd ~ command and press ENTER to change directory to the root of your server space. The root of your server space is the htdocs folder. Type the pwd command and press ENTER again to confirm you are in the htdocs folder.
(uiserver):u12345678:~/Dedicatedhosting4u > cd ~
(uiserver):u12345678:~ > pwd
/kunden/homepages/11/d999999999/htdocs/

Step 4
Next will we make a folder to store all of your MySQL backups in one place. Type mkdir exported Databases to make a subfolder in htdocs/ named exported Databases/. Next, type cd exportedDatabases/ to change directories to the newly created folder.
Please note:
Using SSH, you can use the Tab key on your keyboard to auto-complete existing file and folder names. Try typing "cd export" without the quotes and then hit the Tab key on your keyboard!
(uiserver):u12345678:~ > mkdir exportDatabases
(uiserver):u12345678:~ > cd exportDatabases/
(uiserver):u12345678:~/exportedDatabases >
Step 5
Now that you are in the folder where you want to save the exported database file, you can run the export command. The command will be different depending on whether you have a Web Hosting package or a 1&1 Managed Server package.

greennevaeh
Posts: 7
Joined: Thu Jan 22, 2015 4:18 pm

Re: Backup through SSH?

Post by greennevaeh » Thu Nov 11, 2021 5:56 am

SSH into your server, then use the cd command to go to the directory you want to back up. To see the contents of the folder, type ls at any time. Type the following command after you've gone to the folder: tar -vcf mybackupfile.

Post Reply