How to backup and restore large MySQL databases using mysqldump?

1. Backup database:
#mysqldump -u username -p[username_password] databasename > /path_to_your_db/databasename_backup.sql

For example:
if you backup database with user is root and pass is yourpassword and have the path to your database is /home/username_of_account/public_html/backup_folder/
#mysqldump -u root -pyourpassword databasename> /home/username_of_account/public_html/backup_folder/Your_DB_backup.sql

2. Restore database:

#mysql -u username -p[username_password] databasename < /path_to_your_db/databasename_backup.sql

For example: you want to restore database with user is root and pass is yourpassword then using this command -

mysql -u root -p yourpassword databasename < /home/username_of_account/public_html/backup_folder/Your_DB_backup.sql

Was this answer helpful?

 Print this Article

Also Read

How to install Imagic?

1. # yum install ImageM* netpbm gd gd-* libjpeg libexif gcc coreutils make 2.  # cd...

How to perform the Linux Sever Hardening?

1. Check the hostname is setup or not - hostname 2. Check the IP address is assigned to hostname...

How to install ZendOpcache on CentOS?

The Zend OpCache provides faster PHP execution through opcode caching and optimization. It...

Daily Useful Linux Commands

Finding the username from provided hosting service name - /script/whoowns domain_name Finding...

How to install latest version of git on CentOS release 6.8 (Final)?

Install latest version of git on CentOS release 6.8 - Step 1. Install Dependencies - yum install...

Powered by WHMCompleteSolution