Search
Close this search box.

How to Backup a Database

[bash]
mysqldump [options] db_name [tbl_name …]
mysqldump [options] –databases db_name …
mysqldump [options] –all-databases
[/bash]

single database
[bash title=”single database”]
mysqldump sampledb > sampledb.sql
[/bash]

all databases
[bash]
mysqldump –all-databases > all_databases.sql
[/bash]

backup multiple databases
[bash]
mysqldump –databases database_db1 database_db2 > mutilple_databases.sql
[/bash]

Share this Post:
Scroll to Top