You can easily take Backup of Database by using the following Command Line :

For Single Database :

mysqldump db_name > db_name.sql

For more than One Database :

mysqldump --databases one_database two_database > twodatabases.sql

For all the Databases :

mysqldump --all-databases > alldatabases.sql

You can easily Restore the MySQL Backup by using the following Command Line :

For Restoring Single Backup :

mysql db_name < db_name.sql

For Restoring Single Database from all Backup :

mysql --one-database db_name < alldatabases.sql

If you want to Backup all Databases in the Server as different-SQL files then use following :

This process will create a backup of all the available Databases on the Server and then it will create a zip all the created SQL files and will save the zipped file to the location /backup. Backup of all the databases will be available in the location /backup and the format will be databasename.sql.gz.
for db in `echo 'show databases;' |mysql |grep -Ev
"Database|information_schema|performance_schema"`; do mysqldump $db | gzip > /backup/$db.sql.gz ;done

 

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

Server management

on-demand administration, hardening, migrations and monitoring.

Was this answer helpful?

Still stuck? Open a ticket