How to Backup MySQL Databases

This can be used to back up a database.

1. Export A MySQL Database

This example shows you how to export a database. It is a good idea to export your data often as a backup.

# mysqldump -u [username] -p [password] [database_name] > FILE.sql

Replace [username], [password] and [database_name] with your MySQL username, password and database name.

File FILE.sql now holds a backup of your database, download it to your computer.

2. Import A MySQL Database

Here, we import a database. Use this to restore data from a backup or to import from another MySQL server.

# mysql -u [username] -p [password] [database_name] < FILE.sql

Replace [username], [password] and [database_name] with your MySQL username, password and database name.

This command will backup your database. Simply export your data to a safe place for safe keeping.

  • database, backups, cpanel, mysql
  • 5 Users Found This Useful
Was this answer helpful?

Related Articles

 Using .htaccess File to Block IPs

You may block access to your website from specific IP addresses using .htaccess file. You need to...

 Create Spam Filters for Mailing Lists

This document explains how to create mail filter rules in cPanel's Mailing Lists interface (Home...

 cPanel Mailing Lists

Mailing lists allow you to use a single address to send mail to multiple email addresses. Create...

 Video: Set Default Email Address in cPanel

This video tutorial provides Step-by-Step instructions for setting the Default Email Address in...

 Video: Create Email Filter in cPanel

This video tutorial provides Step-by-Step instructions for creating an email filter in cPanel...