0

By following http://dev.mysql.com/doc/refman/5.1/en/replication-howto-rawdata.html

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

wizztjh
  • 103
  • 4

2 Answers2

2

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

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
2

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 
user9517
  • 115,471
  • 20
  • 215
  • 297