HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Where does the mysqldump command store the backed up databases?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
thedatabaseswheremysqldumpstoredoesbackedcommand

Problem

I am trying to backup my databases through the terminal in Ubuntu using the mysqldump command and it's successful. Where does it place the backed up databases?

I run the command like this:

$ mysqldump -h localhost -u username - p database_name > back_up_db.sql


but have no idea where back_up_db.sql is stored.

Solution

By default it does it to the working directory at the time the command was made. You need to redirect the output to a file if you need to save it.

The place you put the backup is up to you. Ideally, it should be on a different machine in a different physical location. This is why you usually do a remote MySQL dump over SSH and get the data on a different machine. You just pipe the console output over ssh into a file on a different machine.

Context

StackExchange Database Administrators Q#1511, answer score: 12

Revisions (0)

No revisions yet.