Reset mySQL replication

cd /home/anuj/dump

mysql -p

FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;

+—————+———–+————–+——————+
| File          | Position  | Binlog_Do_DB | Binlog_Ignore_DB |
+—————+———–+————–+——————+
| binlog.000662 | 166715532 |              |                  |
+—————+———–+————–+——————+
1 row in set (0.00 sec)

mysqldump  –opt  lory –lock-all-tables –add-drop-table > lory.sql

mysqldump  –opt  rons –lock-all-tables –add-drop-table > rons.sql

UNLOCK TABLES;
quit;

scp -r dump/ anuj@db.anujshrestha.com.np:/home/anuj/db1dump

drop database lory;
create database lory;
use lory;
\. /home/anuj/db1dump/dump/lory.sql

2.

drop database rons;
create database rons;
use rons;
\. /home/anuj/db1dump/dump/rons.sql

stop slave;
CHANGE MASTER TO MASTER_HOST=’db1′, MASTER_USER=’replicationuser’, MASTER_PASSWORD=’pass’, MASTER_LOG_FILE=’binlog.000612′, MASTER_LOG_POS=166715532;
slave start;

show slave status\G;

Slave_IO_Running: Yes
Slave_SQL_Running: Yes

Replication is running

Twitter Digg Delicious Stumbleupon Technorati Facebook

Comments are closed.

Random Pages By Best Accounting Services