back up MySQL database

From Petr Sladek

Jump to: navigation, search

In this tutorial Petr Sladek shows you how to dump a MySQL database to a file from the command line.

Backup command for your MySQL database from the command line or console.

slady@sladek:~$ mysqldump -u<user-name> -p<user-password> <database-name> > backup-file-name.sql

To restore the database from the file use:

slady@sladek:~$ mysql -u<user-name> -p<user-password> < backup-file-name.sql
Personal tools