How to backup and restore MySQL database?

Posted on the September 25th, 2008 under Server Admin Tips by Stephen

You can backup your database automatically using this script

Here are the commands to manually do it via shell, given you have root privilege:

To dump the database onto a text file: mysqldump database_name > database_name.sql

To import the data into a database: mysql database_name < database_name.sql

Replace database_name with the name of your database.


Share this page:
  • Facebook
  • Twitter
  • StumbleUpon
  • Slashdot
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Live
  • MySpace
  • Technorati
  • LinkedIn
  • Reddit
Related Posts:
  1. How to quickly repair MySQL database table using phpMyAdmin?
  2. Useful MySQL shell commands
  3. RPM cheat sheet
  4. Sysadmin Stories: Making backups
  5. Ubuntu LAMP cheat sheet

One Response to 'How to backup and restore MySQL database?'

  1. November 21, 2008 at 6:39 am
    linux tips

Leave a Comment