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
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to install AVG Antivirus scanner on Ubuntu?

AVG free is antivirus which protects from spyware as well malware. It is free to use for private...

How to setup a WordPress website on plain Centos server?

The following steps have been successfully tested on a plain centos server. Now lets start...

How to change the port number of Apache Web Server?

Default port to access the Apache is 80. Secure port for communicating with world for Apache is...

How to install Postfix on CentOS?

Postfix is an open-source Mail Transport Agent (MTA), which supports protocols like LDAP, SMTP...

How to install SOAP on CentOS?

Install SOAP on CentOS 1) Fire below command - yum install php-soap Output will be as follow...

Powered by WHMCompleteSolution