Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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...

share|improve this answer

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

share|improve this answer
    
Why copy innodb log file?... ib_logfile* does't carry information. –  alvosu Jan 29 '11 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 '11 at 21:17
    
He correctly stopped MySQL. About what a crash you tell? –  alvosu Jan 31 '11 at 5:28

Your Answer

 
discard

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.