By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

Mysql Master - Server Replication

100+
P: 147
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

Expand|Select|Wrap|Line Numbers
  1. mysql>GRANT REPLICATION SLAVE ON *.* TO 'slaveuser'@'10.93.210.211'
  2. IDENTIFIED BY 'slave';



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


Steps in Slave Server:

Expand|Select|Wrap|Line Numbers
  1. 1. Changes in my.cnf file
  2.                      (uncommented this two lines in my.cnf file)
  3.  
  4.                      server-id = 2
  5.  
  6. 2.login :
  7. shell>mysql -u root -proot
  8.  
  9. mysql>CHANGE MASTER TO
  10. MASTER_HOST=’10.93.210.133’,
  11. MASTER_USER=’slaveuser’,
  12. MASTER_PASSWORD=’slave’,
  13. MASTER_PORT=3306,
  14. MASTER_LOG_FILE=’mysql-bin.000001',
  15. MASTER_LOG_POS=98,
  16. MASTER_CONNECT_RETRY=10;
  17.  
  18. mysql>start slave;
  19. 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 ?
Jun 11 '10 #1
Share this Question
Share on Google+
2 Replies


mwasif
Expert 100+
P: 801
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.
Expand|Select|Wrap|Line Numbers
  1. CHANGE MASTER TO
  2. MASTER_HOST=’10.93.210.133’,
  3. MASTER_USER=’slaveuser’,
  4. MASTER_PASSWORD=’slave’,
  5. MASTER_PORT=3306,
  6. MASTER_LOG_FILE=’mysql-bin.000001',
  7. MASTER_LOG_POS=98,
  8. MASTER_CONNECT_RETRY=10;
Jun 17 '10 #2

100+
P: 147
Yes,i restarted the master server and the slave server.
Jun 18 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.