My Oracle Support Banner

Mysqlbinlog --read-from-remote-server : Got Error Reading Packet From Server: Lost Connection (Doc ID 2298022.1)

Last updated on FEBRUARY 13, 2019

Applies to:

MySQL Server - Version 4.0 and later
Information in this document applies to any platform.


 In the case of saving or post-processing the binary logs from a live mysqld instance,   mysqlbinlog might intermittently fail with error:

mysqlbinlog --host= --port=3306 --read-from-remote-server s-bin.000002 --base64-output=decode-rows -vv | perl
ERROR: Got error reading packet from server: Lost connection to MySQL server during query
WARNING: The range of printed events ends with a row event or a table map event that does not have the STMT_END_F flag set. This might be because the last statement was not fully written to the log, or because you are using a --stop-position or --stop-datetime that refers to an event in the middle of a statement. The event(s) from the partial statement have not been written to output.


In mysql error log one would see a Note like this (assuming all warnings are enabled) :  

2017-08-14T10:40:43.556906Z 3 [Note] Start binlog_dump to master_thread_id(3) slave_server(0), pos(s-bin.000002, 4)
2017-08-14T10:41:12.081559Z 3 [Note] Aborted connection 3 to db: 'unconnected' user: 'root' host: '' (Failed on my_net_write())


No specific changes to the environment are to blame.  Problem might occur on slow client machine, slow network connection,  or on a huge binary log that just takes longer.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.