Mysql Master - Server Replication

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • santhanalakshmi
    New Member
    • May 2009
    • 147

    Mysql Master - Server Replication

    hi,

    I am trying to set Master-Server Replication.I followed the following steps,even though slave can't able to connect the master.

    master ip : 10.93.210.133
    slave ip : 10.93.210.211

    Steps in Master Server:

    1. Changes in my.cnf file
    (uncommented this two lines in my.cnf file)
    log-bin = mysql-bin
    server-id = 1

    2.Restarted mysql

    3.login as root in mysql and creating new users look on this

    Code:
    mysql>GRANT REPLICATION SLAVE ON *.* TO 'slaveuser'@'10.93.210.211'
    IDENTIFIED BY 'slave';



    4.show master status;
    (for mysql file and position)


    Steps in Slave Server:

    Code:
    1. Changes in my.cnf file
                         (uncommented this two lines in my.cnf file)
                         
                         server-id = 2
    
    2.login :
    shell>mysql -u root -proot
    
    mysql>CHANGE MASTER TO
    MASTER_HOST=’10.93.210.133’,
    MASTER_USER=’slaveuser’,
    MASTER_PASSWORD=’slave’,
    MASTER_PORT=3306,
    MASTER_LOG_FILE=’mysql-bin.000001',
    MASTER_LOG_POS=98,
    MASTER_CONNECT_RETRY=10;
    
    mysql>start slave;
    empty rows affected



    By seeing,mysql log on slave server ....showing an error message,can't connect to master.

    Please see this step and solve my problem....did i made any mistakes in setting master - slave replication ?
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Did you restart the slave after editing my.cnf?

    Make sure you use single quotes not the back ticks around values in the below statement.
    Code:
    CHANGE MASTER TO
    MASTER_HOST=’10.93.210.133’,
    MASTER_USER=’slaveuser’,
    MASTER_PASSWORD=’slave’,
    MASTER_PORT=3306,
    MASTER_LOG_FILE=’mysql-bin.000001',
    MASTER_LOG_POS=98,
    MASTER_CONNECT_RETRY=10;

    Comment

    • santhanalakshmi
      New Member
      • May 2009
      • 147

      #3
      Yes,i restarted the master server and the slave server.

      Comment

      Working...