MySQL Forums
Forum List  »  Replication

Re: Rep. Problem
Posted by: James Day
Date: January 27, 2005 11:57AM

This assumes that your slave is not being used for work and that you are using MyISAM tables on master and slave. Also, it is best to do it while there are few insert, update and delete operations on the master:

1. grant select rights to the slave on the master: GRANT REPLICATION SLAVE, SELECT ON *.* TO 'repl'@' new-slave ' IDENTIFIED BY 'slavepass' ;

2. create a test table on the master. On the slave, let replication produce it then use drop table and LOAD TABLE test_table FROM MASTER to get a new copy from the master. If it works, you can now use this for your main database tables.

3. stop slave

4. on slave, drop table for each changed table, load table tablename from master for each table

5. start slave

If there were inserts or deletes happening on the master while you were copying the tables you will see errors on the slave when replication tries to touch those records. Use STOP SLAVE; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE; to skip each of them.

Alternatively, you could shut down the master and slave database servers and copy the files from master to slave. This is one of the situations where it is good to have two slaves. If you have a problem with any of the three computers you can leave one running and another to copy to the one with the problem. A backup-only slave (one you only use for this) can be a relatively slow computer, perhaps a web server doing this as an extra task.

Options: ReplyQuote

Written By
January 26, 2005 10:37PM
Re: Rep. Problem
January 27, 2005 11:57AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.