The Movable Type Knowledge Base

Backup MySQL Database

Question

How can I back up all of the data in my MySQL database?

Answer

When using MySQL for your database, you can export the entries, comments, templates, and all settings into a single file.

Using phpMyAdmin

If your host has phpMyAdmin available on your server, you can use this tool to export your database.

  • After selecting your database, click the Export link. This should bring up a new screen that says View dump (schema) of database (or something similar).

  • In the Export area, click the Select All link to choose all of the tables in your database.

  • In the SQL options area, make sure both the Structure and Data options are selected.

  • Check Save as File and then click the Go button. A dialog box should appear prompting you to save the file locally.

From the Command Line

You can also create a backup with command line access:

mysqldump -h server -u username -ppassword database > filename

using the appropriate values:

  • server - your MySQL server name
  • username - your database username
  • password - your database password (note there is no space between -p and the password)
  • database - your database name
  • filename - the name you want for the dump file

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.