Support Center » Knowledgebase » Database Topics » How do I backup/export my MySQL database?

How do I backup/export my MySQL database?



Backing up your MySQL database can be done in several ways:

  1. Using phpMyAdmin web interface
  2. Using command line through shell access

Using phpMyAdmin

You can launch phpMyAdmin via the "phpMyAdmin" icon located on the home screen of the Quadra control panel. Click on the small play icon that corresponds to the relevant database user. The phpMyAdmin tool can export your entire database by selecting the "Export" page.

  • Click "Custom"
  • Under "Tables:", ensure all tables are selected
  • Under "Output:", select "Save output to a file"
    • We recommend selecting "zipped" or "gzipped" option for compression.
  • Under "Format-specific options:", select "Structure and data"
  • Under "Object creation options:", select "Add drop table" and "Enclose table and field names with backquotes"
  • Then, click "Go"

You will be prompted to save the dump file on your computer.

 

Using mysql command line tools

To use MySQL command line tools, you would need to have shell access on Unix hosting. You can perform backup using the following command:

mysqldump -h servername -u username -p --opt -Q --routines --events --triggers databasename > databasedump.sql

To backup and compress your dump file into a gzip file:

mysqldump -h servername -u username -p --opt -Q --routines --events --triggers databasename | gzip > databasedump.sql.gz

The commands above will create the dump file in your current directory. You can download this backup file using scp or ftp for your archival purposes. If the mysqldump command is not available, please contact Quadra Hosting technical support.

 

Restoring MySQL Dump File

To restore your dump file / backup, please see https://support.quadrahosting.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=49&nav=0,4,11



Article Details
Article ID: 73
Created On: 31 Dec 2003 06:00 AM
 Back
 Login [Lost Password] 
Email:
Password:
Remember Me:
Please note that the login and password to the support area is NOT the same as your hosting control panel login and password
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Downloads | Control Panel User's Guide | Server Status
Language: