How to back up your MySQL database: Difference between revisions

From SWCP Support Wiki
Jump to navigationJump to search
Created page with 'There are many ways to back up your MySQL database. We'll cover the simplest one, using phpMyAdmin. Of course parts of this apply specifically to a database at SWCP, but most o...'
 
No edit summary
Line 1: Line 1:
There are many ways to back up your MySQL database.  We'll cover the simplest one, using phpMyAdmin.  Of course parts of this apply specifically to a database at SWCP, but most of it would be applicable for any MySQL database accessed with phpMyAdmin.
There are many ways to back up your MySQL database.  We'll cover the simplest one, using phpMyAdmin.  Of course parts of this apply specifically to a database at SWCP, but most of it would be applicable for any MySQL database accessed with phpMyAdmin.


Start by logging in to phpMyAdmin at [https://pma5.swcp.com].  If you don't know the username and password, but your web application is using the database, you can usually find the info in the configuration files of the web application.  For example if you are using Joomla, they will be found in the '''configuration.php''' file in the root of your Joomla directory.
Start by logging in to phpMyAdmin at [https://pma5.swcp.com https://pma5.swcp.com].  If you don't know the username and password, but your web application is using the database, you can usually find the info in the configuration files of the web application.  For example if you are using Joomla, they will be found in the '''configuration.php''' file in the root of your Joomla directory.


On the main phpMyAdmin page, you should see your database name in the upper left (right below the "Home", "Exit", etc. icons).  Click it.  Now there is a row of options accross the top and one of them is "Export".  Click the "Export" button.
On the main phpMyAdmin page, you should see your database name in the upper left (right below the "Home", "Exit", etc. icons).  Click it.  Now there is a row of options accross the top and one of them is "Export".  Click the "Export" button.

Revision as of 17:14, 27 October 2010

There are many ways to back up your MySQL database. We'll cover the simplest one, using phpMyAdmin. Of course parts of this apply specifically to a database at SWCP, but most of it would be applicable for any MySQL database accessed with phpMyAdmin.

Start by logging in to phpMyAdmin at https://pma5.swcp.com. If you don't know the username and password, but your web application is using the database, you can usually find the info in the configuration files of the web application. For example if you are using Joomla, they will be found in the configuration.php file in the root of your Joomla directory.

On the main phpMyAdmin page, you should see your database name in the upper left (right below the "Home", "Exit", etc. icons). Click it. Now there is a row of options accross the top and one of them is "Export". Click the "Export" button.

There are many options on the Export page, but most of them will already be set to good defaults. Here are a couple to check and/or change:

  • Under "Export" on the left you can pick the format of exported data. Select "SQL". You may have reason to want another format such as CSV, but in general, if the purpose is to be able to restore the database after a mishap, select SQL.
  • Click the "Save As File" option near the bottom. The File Name Template setting should already say "_DB_". If it says something else, go back to the beginning: click the database name link in the upper left, then the Export button in the upper right.
  • If your database is very large, you can select a compression option such as "Zip" under the "Save As File" option. Most databases aren't large enough for this to matter though.

Now click the "Go" button in the lower right. After a few seconds you should be prompted to save a file, which will be the backup copy of your database. You can view the backup in any text editor -- it should contain a bunch of readable SQL commands.

If you have any questions, please email help@swcp.com

See Also