Header Ads

ad728
  • Breaking News

    Database Mysql Replication host Windows xp and Linux Centos 6.3


    1. Configure the master (Windows xp)
    find Mysql configuration file my.ini or my.cnf (under linux)
    c://xampp/mysql/bin/my.ini
    
    #Place where you install Mysql Database
    
    
    
    open my.ini and add the following line
    [mysqld]
    server-id = 1
    log-bin = c://xampp/mysql/mysql-bin.log
    binlog-do-db = oke
    
    # Change here for bind listening
    bind-address=0.0.0.0 
    
    "oke" is the name of database to be replicated
    bind address = 0.0.0.0 mean that your sql server accept connection from all ip address
    Then restart your master server
    service mysqld start
    #on Linux
    
    Enter mysql shell
    Grant privileges to User (arif) on Slave Mysql Database to Master Mysql Database
    GRANT REPLICATION SLAVE ON *.* TO 'arif'@'10.100.159.3' 
    IDENTIFIED BY 'arif';
    FLUSH PRIVILEGES;
    
    "arif" = username on Slave Mysql Database and also Password for user "arif"
    10.100.159.2 = ip address of Slave Mysql Database
    FLUSH PRIVILEGES = refresh privileges mysql
    SHOW MASTER STATUS;
    +---------------+----------+--------------+------------------+
    | File          | Position | Binlog_do_db | Binlog_ignore_db |
    +---------------+----------+--------------+------------------+
    | mysql-bin.006 | 183      | oke          |                  |
    +---------------+----------+--------------+------------------+
    1 row in set (0.00 sec)
    
    2. Configure Slave My Sql Database
    Install mysql-server
    yum install mysql-server
    
    start mysql service
    service mysqld start
    
    edit my.cnf
    server-id=2
    master-host=10.100.159.1
    master-user=sarif
    master-password=arif
    master-connect-retry=60
    replicate-do-db=oke
    
    restart mysql server
    service mysqld restart
    
    and on mysql shell write
    show slave status;
    






    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728