List:Replication« Previous MessageNext Message »
From:Hartleigh Burton Date:October 4 2007 3:02am
Subject:Re: Adding a DB to a replication set
View as plain text  
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.


Thread
Adding a DB to a replication setMarcus Bointon4 Oct
  • Re: Adding a DB to a replication setHartleigh Burton4 Oct
    • Re: Adding a DB to a replication setDatabase System4 Oct