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)