Ausweb Web Hosting and Web Development Tutorials

banner-tutorials
You are here

Backing up databases over SSH

Sometimes a MySQL database is simply too large to backup on a web based interface. In the event of this occurring, it is fairly easy to backup a database via SSH; all it takes is one command. This tutorial will show you how.

First of all, login to SSH either as root or elevate yourself to root status.

mysqldump -u user -p password -h host dbname > outputfile

The terms highlighted in bold need to be filled out by you. A brief overview of what they are:

  • user: The user that has access to the database you want to backup
  • password: The password of that user
  • host: Your database host; usually setting this to localhost works fine
  • dbname: The name of the database you want to backup
  • outputfile: The name of the file you want to backup the database to.

Here is an example:

mysqldump -u john -p johnpass -h localhost john_db > /home/john/backup.sql

This will backup the database john_db to /home/john/backup.sql. Keep in mind for very large files, this will take some time, so be patient. Once it is finished, you will be returned to the command line.

For more information regarding mysqldump and for tips about advanced usage, take a look at this article:

dev.mysql.com/doc/refman/5.0/en/mysqldump.html

Articles In This Category
More from this Category
Tutorials > PHP and MySql
PHP (PHP:Hypertext Preprocessor) was designed to create dynamic web pages, PHP's principal focus is server-side scripting. While running the PHP parse...
Tutorials > PHP and MySql
If you've recently installed phpNuke with Fantistico (it's at the bottom of your Control Panel - if you haven't seen it - go look), you may have notic...
Tutorials > PHP and MySql
The MySQL option in your control panel automates MySQL. The following information will assist you in using and implementing MySQL. We do not provide...
Tutorials > PHP and MySql
The following scripts are banned due to these scripts causing harm to other sites on the same server. AlienForm (all versions) Greymatter (all ver...
Tutorials > PHP and MySql
The official PHP site is http://www.php.net and the online documentation is found at http://www.php.net/manual If you would rather follow a tutorial,...
Related Articles
Related Articles
Plesk Tutorials > Plesk 10 - Tutorials
The following video tutorial will guide you through creating a database in Plesk10...
Plesk Tutorials > Plesk 10 - Tutorials
The following video tutorial will guide you through managing your Databases with WebAdmin in Plesk10...
cPanel-WHM > cPanel Sever Management
To change the SSH port number login as root, and edit /etc/ssh/sshd_config Find the line that says Port 22 and change 22 to any number between 1024-&...
Plesk Tutorials > Windows Plesk ASP.NET tutorials
Windows Plesk ASP.NET - Backing Up Your MSSQL Database Using MyLittleAdmin There are two methods of MSSQL database backups offered on our Windows Pl...
Virtual Server Tutorials > VPS Hosting Tutorials
This is a video on how to connect to your VPS using SSH....
Latest Articles
Latest Articles
Tutorials > Domain Names
What are glue records? If the nameserver (NS) is a subdomain of the domain you want to configure, e.g. you want to set ns1.yourdomain.com and ns2.y...
Tutorials > Email Tutorial : FAQ for Email setup
This guide will help you configure your AUSWEB hosted email address with Outlook 2010....
Tutorials > Email Tutorial : FAQ for Email setup
This guide will help you setup and configure your AUSWEB hosted email address with Windows Live Mail (Outlook 2011)....
Tutorials > Partner (Affiliate) Guide
1. Visit http://partner.ausweb.com.au and click “Join Now” from the top navigation bar (or click the shiny green “Sign Up Now” button....
Tutorials > Website Security/Upgrade Issues
After installing an SSL, a commmon subsequent issue (in most modern browsers) is the the dreaded "Connection Partially Encrypted" warning.   The er...
Most Read Articles
Most Read Articles
Tutorials > Joomla FAQ
A vulnerable extension is one that has been found to contain, or contribute to, a security vulnerability. Vulnerable extensions are not necessarily p...
Bad karma: we can't find that page! You asked for {%sh404SEF_404_URL%}, but despite our computers looking very hard, we could not find it. What happe...
Tutorials > phpBB Forum Hosting
Finally, after a long wait, phpBB3 has been released, and its relatively easy to upgrade your existing phpBB installation. phpBB3 introduces hundreds...
Tutorials > phpBB Forum Hosting
This video tutorial will show you how to create a new topic in phpBB3....
Tutorials > Email Tutorial : FAQ for Email setup
Configuring your new iPhone or iPad to receive mail from your Ausweb hosted email accounts is a very easy process. This tutorial will give you a si...