MySQL's simple master-slave replication (Ubuntu)

Source: Internet
Author: User

Environment: Two Ubuntu 12.04.5 virtual machinesMySQL-server-5.5Master (192.168.240.130) Slave (192.168.240.129)(1See if binary logs are turned on show variables like' Log_bin ';(2) Login master, open a database account grant REPLICATION SLAVE on* * to ' daxia ' @ ' 192.168.240.129 ' identified by ' 123456 ';(3) Modify Master My.cnf File Server-id = 1#host flag, IntegerLog_bin =/var/Log/MySQL/MySQL-bin.Log#Make sure this file is writable and open Bin-logRead-only =0#Read and write can be, or do not writebinlog- Do-db =daixa#You need to back up data, write multiple lines, or notBinlog-ignore-db =MySQL #databases that do not need to be backed up, multiple write multiple lines, or no(4) View host status show master status;5) configuration Slavelog_bin=  /var/Log/MySQL/MySQL-bin.Logserver_id= 2log_slave_updates= 1#write logs to the binary log from the serverREAD_ONLY = 1#Read-only(6) Let slave link master (this part of the configuration is not put to my.)cnf inside)MySQL> Change MASTER to master_host= ' 192.168.240.130 ',-> master_user= ' daxia ',-> master_password= ' 123456 ',-> Master_log_file= ' mysql-bin.000001 ',-> master_log_pos=0; The value of Master_log_pos is 0 because it is the starting position of the log (7) Verify whether SLAVE turns on show SLAVE status\g can use start SLAVE if it is not turned on;8) View Master-slave i/oshow processlist \g problem Description (1the problem that the master never synchronizes;: Master is no problem,view slave show slave status\gslave_io_running:yesslave_sql_running:No solution:stop slave;#indicates a skip step error, followed by a variable numberSetGlobalSql_slave_skip_counter =1; start slave;

MySQL's simple master-slave replication (Ubuntu)

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.