diff --git a/pymysqlreplication/binlogstream.py b/pymysqlreplication/binlogstream.py index fa65aa22..8758e1bd 100644 --- a/pymysqlreplication/binlogstream.py +++ b/pymysqlreplication/binlogstream.py @@ -166,7 +166,8 @@ def __init__(self, connection_settings, server_id, skip_to_timestamp: Ignore all events until reaching specified timestamp. report_slave: Report slave in SHOW SLAVE HOSTS. - slave_uuid: Report slave_uuid in SHOW SLAVE HOSTS. + slave_uuid: Report slave_uuid or replica_uuid in SHOW SLAVE HOSTS(MySQL 8.0.21-) or + SHOW REPLICAS(MySQL 8.0.22+) depends on your MySQL version. fail_on_table_metadata_unavailable: Should raise exception if we can't get table information on row_events @@ -301,7 +302,7 @@ def __connect_to_stream(self): if self.slave_uuid: cur = self._stream_connection.cursor() - cur.execute("set @slave_uuid= '%s'" % self.slave_uuid) + cur.execute("SET @slave_uuid = %s, @replica_uuid = %s", (self.slave_uuid, self.slave_uuid)) cur.close() if self.slave_heartbeat: