0

I'm following http://dev.mysql.com/doc/refman/5.0/en/replication-howto-rawdata.html to copy data from one master to slave for replication, the instruction for copying is one of the following:

tar cf /tmp/db.tar ./data
shell> zip -r /tmp/db.zip ./data
shell> rsync --recursive ./data /tmp/dbdata

I look under /var/lib/mysql and see

ibdata1
mysql-bin.000142
database1
database2
...

should I copy ibdata1 for db replication? doesn't this include all data(including mysql admin stuff) and would it mess up my slave database? should I copy each individual databases(database1,database2)?

2 Answers 2

1

should I copy ibdata1 for db replication?

Yes.

doesn't this include all data(including mysql admin stuff) and would it mess up my slave database?

No, only innodb data.

should I copy each individual databases(database1,database2)?

Yes, if they will be replicated.

Don't copy binlog, relaylogs, master.info, *.flag, *.pid, etc...

0

ibdata1 is the data file for tables stored using the InnoDB engine. it's used by the engine to keep track of data. in this case you need to copy it - also look to see if there are any ib_logfile that you need to copy as well. the rest is not need it except the databases1-2

3
  • Why copy innodb log file?... ib_logfile* does't carry information.
    – alvosu
    Jan 29, 2011 at 19:38
  • in the new version of mysql is not used for database recovery, but into some older ones were used to recover from a crash. see innodb_log_archive.
    – silviud
    Jan 30, 2011 at 21:17
  • He correctly stopped MySQL. About what a crash you tell?
    – alvosu
    Jan 31, 2011 at 5:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .