Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Adding a DB to a replication set

From: Hartleigh Burton <hburton(at)mraentertainment.com>
Date: Wed Oct 03 2007 - 23:02:28 EDT


I would first of all create the databases as you have done on both servers, then edit the my.cnf file on the slave...

replicate-do-db = existingdatabasethatisreplicating replicate-do-db = newdatabasethatyouwanttoreplicate (each database does need to be specified in a new replicate-do-db line) report-host = 192.168.1.15 (address of master server for reporting)

then on the slave do...

mysql > stop slave;
mysql > show slave status\G (to make sure it is not running)

restart mysql on slave and show status again...

mysql> show slave status\G

*************************** 1. row ***************************
              Slave_IO_State: Waiting for master to send event
                 Master_Host: 192.168.1.15
                 Master_User: slaveuser
                 Master_Port: 3306
               Connect_Retry: 60
             Master_Log_File: mysql-bin.000004
         Read_Master_Log_Pos: 206957999
              Relay_Log_File: grumpy-relay-bin.000231
               Relay_Log_Pos: 39338
       Relay_Master_Log_File: mysql-bin.000004
            Slave_IO_Running: Yes
           Slave_SQL_Running: Yes
             Replicate_Do_DB:  

existingdatabasethatisreplicating,newdatabasethatyouwanttoreplicate,exis tingdatabasethatisreplicating,newdatabasethatyouwanttoreplicate
         Replicate_Ignore_DB:
          Replicate_Do_Table:
      Replicate_Ignore_Table:
     Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                  Last_Errno: 0
                  Last_Error:
                Skip_Counter: 0
         Exec_Master_Log_Pos: 206957999
             Relay_Log_Space: 39338
             Until_Condition: None
              Until_Log_File:
               Until_Log_Pos: 0
          Master_SSL_Allowed: No
          Master_SSL_CA_File:
          Master_SSL_CA_Path:
             Master_SSL_Cert:
           Master_SSL_Cipher:
              Master_SSL_Key:
       Seconds_Behind_Master: 0

1 row in set (0.00 sec)

you should notice that replication has automatically started with the server and is running with the new database listed. hope this helps. Received on Wed Oct 3 23:02:44 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:14:25 EDT

Do you need help?X

Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library