MySQL: Resync Replication

Mysql-Replication-Resync
> = Mysql
$ = User Shell
# = Root Shell

*** MASTER ***
>
RESET MASTER;
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;

#
mysqldump -uroot -p –all-databases > /a/path/mysqldump.sql

>
UNLOCK TABLES;

*** SLave ***

#

>
STOP SLAVE;

#
mysql -uroot -p < mysqldump.sql >
RESET SLAVE;
CHANGE MASTER TO MASTER_LOG_FILE=’mysql-bin.000001′, MASTER_LOG_POS=98

(Where the values of the above fields are the ones you copied before)

START SLAVE;
SHOW SLAVE STATUS;

(expected output:)
Slave_IO_Running: Yes
Slave_SQL_Running: Yes

///// OPTIONS FOR INNODB /////
–opt –single-transaction –comments –hex-blob –dump-date –no-autocommit –all-databases

—–
RESET SLAVE;
START SLAVE;

Schreibe einen Kommentar