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?
Backup through SSH?
-
- Posts: 6
- Joined: Wed Jan 21, 2015 2:21 pm
Re: Backup through SSH?
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.
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.
-
- Posts: 7
- Joined: Thu Jan 22, 2015 4:33 pm
Re: Backup through SSH?
Thanks to all,for this very helpful topic.
Thanks.
Thanks.
-
- Posts: 7
- Joined: Wed Jan 21, 2015 4:11 pm
Re: Backup through SSH?
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.
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.