PinoyTech.org

CodeIgniter, Kohana, Mootools, jQuery and CSS

Using mysqldump to backup a database

Posted by teejay on January 3, 2012

mysqldump is quite a nice program for downloading and SQL dump from a mysql server. It's quite easy to use. Here's a basic mysqldump usage for backing up a database.

  mysqldump -u username -p your_database > your_database_backup.sql
  Enter password:
  • -u for the username
  • your_database is the database name that you will backup
  • your_database_backup.sql will be the file name where the backup will be saved

Options

Here are a few options you could check:

  • -vVerbose mode. Print more information about what the program does.
  • -XWrite dump output as well-formed XML.

The script above logins using your provided username and password and downloads a dump from your_database and save it on your_database_backup.sql file

Categories: Web Development

Tags: mysqldump

No Comments

Comments are not allowed