mysql-python-replicator binlog start pos for specific schema -
i'm using mysql-python-replicator dump data mysql specific database ,so can create binglogstream parameters only-schema:
stream = binlogstreamreader(connection_settings=mysql_settings, server_id=1,only_schemas='tpch', log_file='mysql-bin.000001',log_pos=1 )
i have parameters log_file='mysql-bin.000001'
,and log_pos=1
,because have no idea event position start,so ideas find start event position database in mysql-binlog ?
guessing first binlog position won't work. file , position might not exist on server because mysql automatically rotates logs based on configuration.
the library internally knows how start beginning. leave out 3 parameters needed resuming (or set them false / none):
if binlog_filename none or binlog_position none: # connecting mysql binlog (from beginning)... binlog_stream = binlogstreamreader( connection_settings=mysql_settings, server_id=1, blocking=true ) else: # continuing binlog_filename , binlog_position binlog_stream = binlogstreamreader( connection_settings=mysql_settings, server_id=1, resume_stream=true, blocking=true, log_file=binlog_filename, log_pos=binlog_position )
Comments
Post a Comment