MySQL master-slave operations in windows

Source: Internet
Author: User

MySQL master-slave in windows

MySQL replication settings

 
 
  1. Set up MySQL replication and control slave thread  

MySQL master-slave backup

Recommendation circle: Database circle

For more information, we recommend that you install MySQL

1. install two MySQL instances first, that is, copy a MySQL master-slave instance)

2. Modify the port number and installation address (my. ini). Here we do not use the default port 3306 for main tests.

Xml Code

 
 
  1. MySQL5.1   
  2. [client]   
  3. port=3307   
  4. [MySQLd]   
  5. port=3307   
  6. basedir="E:/MySQL5.1/"   
  7. datadir="E:/MySQL5.1/Data/"   
  8. MySQL5.2   
  9. [client]   
  10. port=3308   
  11. [MySQLd]   
  12. port=3308   
  13. basedir="E:/MySQL5.2/"   
  14. datadir="E:/MySQL5.2/Data/"   
  15. MySQL5.1  
  16. [client]  
  17. port=3307 
  18. [MySQLd]  
  19. port=3307 
  20. basedir="E:/MySQL5.1/" 
  21. datadir="E:/MySQL5.1/Data/" 
  22. MySQL5.2  
  23. [client]  
  24. port=3308 
  25. [MySQLd]  
  26. port=3308 
  27. basedir="E:/MySQL5.2/" 
  28. datadir="E:/MySQL5.2/Data/" 

3. Create a backup account in the Master (MySQL5.1) database. The command is as follows:

SQL code

 
 
  1. GRANT REPLICATION SLAVE ON *.* TO 'slave'@'localhost' IDENTIFIED BY '123456';   
  2. GRANT REPLICATION SLAVE ON *.* TO 'slave'@'localhost' IDENTIFIED BY '123456';  
  3.  

The above content is an introduction to MySQL master-slave in windows. I hope you will have some gains.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.