MySQL master-Slave synchronization error resolution and Slave_io_running:no

Source: Internet
Author: User

1, there are error prompts,

Slave I/o: Error connecting to master ' [email protected]:3306 '-retry-time:60 retries:86400, error_code:1045

Workaround

Remove all binary log files from the server, including a master.info file under a data directory and a file beginning with Hostname-relay-bin.

Master.info:: Logs the log file and record location on the MySQL master server, and the password of the connection.

2. Error message appears


Error reading packet from Server:file '/home/mysql/mysqllog/log.000001 ' not Found (errcode:2) (server_errno=29)

Solution:

Since the primary server has been running for a while, resulting in a binary file, and slave is read from log.000001 , delete the host binaries, including the log.index file.

3, Error prompts as follows


Slave sql:error ' Table ' xxxx ' doesn ' t exist ' on query. Default database: ' t591 '. Query: ' INSERT into ' xxxx ' (type,post_id,browsenum) SELECT type,post_id,browsenum from xxxx WHERE hitdate= ' 20090209 ', error_code:1146

Workaround

Since slave does not have this table table, it can be added using slave start to continue the synchronization.

4, Error prompts as follows

Error ' Duplicate entry ' 1 ' for key 1 ' on query. Default database: ' Movivi1 '. Query: ' INSERT into ' v1vid0_user_samename ' VALUES (null,1, ' 123 ', ' 11 ', ' 4545 ', ' 123 ') '

Error ' You had an error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use near "at line 1 ' on query. Default database: ' Club '. Query: ' INSERT into Club.point_process (Giveid, GETID, point, Createtime, DEMO) VALUES (0, 4971112, 5, ' 2010-12-19 16:2 9:28 ', '

1 row in Set (0.00 sec)

Mysql > Slave status\g;

Display: slave_sql_running for NO

Workaround:

Mysql > Stop slave;

Mysql > Set global sql_slave_skip_counter = 1;

Mysql > Start slave;

5, Error prompts as follows

# show Slave status\g;

 

master_log_file:mysql-bin.000029

read_master_log_pos:3154083

relay_log_file:c7-relay-bin.000178

relay_log_pos:633

relay_master_log_file:mysql-bin.000025

Slave_io_running:yes

Slave_sql_running:no

Replicate_do_db:club

replicate_ignore_db:

Replicate_do_table:

Replicate_ignore_table:

Replicate_wild_do_table:

Replicate_wild_ignore_table:

last_errno:1594

last_error: relay log read failure: could not parse  Relay log event entry. the possible reasons are: the master ' s  binary log is corrupted  (you can check this by running   ' Mysqlbinlog '  on the binary log),  the slave ' S relay log is  corrupted  (you can check this by running  ' Mysqlbinlog '  on  The relay log), a network problem, or a bug in the  Master ' S or slave ' s mysql code. if you want to check the  master ' S binary log or slave ' s relay log, you will be  able to know their names by issuing  ' Show slave status '  on  this slave.

skip_counter:0

exec_master_log_pos:1010663436

This problem occurs because the primary database suddenly stops or the problem terminates, changes the mysql-bin.xxx log,theslave Server cannot find the file, needs to find the synchronized point and log file, and then chage Master can be.

Workaround:


Change Master to

Master_host= ' 211.103.156.198 ',

Master_user= ' Sync account ',

master_password= ' sync password ',

master_port=3306,

Master_log_file= 'mysql-bin.000025',

master_log_pos=1010663436;

6, Error prompts as follows

 

error  ' unknown column  ' Qdir '  in  ' field list '  on query. default database :  ' Club ' . query:  ' insert into club.question_del  (Id, pid, ques_name,  givepoint, title, subject, subject_pid, createtime, approve, did,  Status, intime, order_d, endtime,banzhu_uid,banzhu_uname,del_cause,qdir)  select id,  pid, ques_name, givepoint, title, subject, subject_pid, createtime,  Approve, did, status, intime, order_d, endtime, ' 1521859 ', ' admin0523 ', '

1 row in set  (0.00 sec)

This error is said that the Club.question_del table does not have qdir This field caused by the addition can be ~!

In the main MySQL : Inside query the Desc Club. Question_del;

Executing on the wrong slave server: ALTER TABLE Question_del add Qdir varchar (+) not null;

7, Error prompts as follows

Slave_io_running:no

This error is the IO process is not connected, find a way to connect with the main POS number and file must be correct, and then reload the next data. Specific steps:

Slave stop;
Change Master to master_host= ' IP address ', master_user= ' Club ', master_password= ' Mima ', master_log_file= ' mysqld-bin.000048 ' , master_log_pos=396549485;
Note: master_log_file= ' mysqld-bin.000048 ', master_log_pos=396549485, is found from the top of the Lord: Show Master Status\g;

LOAD DATA from MASTER;

Load data from Master;

Slave start;

Problem Solving!

This article is from the "Learning to Eternity" blog, please make sure to keep this source http://hzcsky.blog.51cto.com/1560073/479476

MySQL master-Slave synchronization error resolution and Slave_io_running:no

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.