Select Page

Assuming you are a superuser, create a new database:

Import data:

Dump the db:

Backup!

Here’s a script called db_backup (make the file executable with chmod a+x filename):

Edit the crontab with crontab -e and add the following line (which runs every day at 11 pm and logs to the file specified):

Alternately you can backup all databases with one command:

Or backup the database files directly from /var/lib/mysql/. You don’t have to be a guru to administer your databases (though some knowledge of relational databases & SQL definitely helps). PHPMyAdmin is a handy tool that you should setup if you haven’t already.