Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By following

I stuck when it ask me to shell> tar cf /tmp/db.tar ./data, where is ./data ?

share|improve this question
up vote 2 down vote accepted

That is your MySQL data directory. Typical location is /var/lib/mysql, but check that out from your my.cnf file.

share|improve this answer

That would be wherever your datafiles are stored. Have a look in your my.cnf file for the line

datadir = /some/path

You will most likely have to modify the command slightly based on what you find. e.g. if your datadir is /var/lib/mysql then you would need to

cd /var/lib/mysql tar cf /tmp/db.tar ./data

where data is the name of the database you want to move.

If you want to move everything then

cd /var/lib
tar cf /tmp/db.tar ./mysql 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.