TungNT (Blue)

tungnt.blue@gmail.com

User Tools

Site Tools


development:database:mysql:debezium

This is an old revision of the document!


Debezium MySQL

Binlog (binary log)

Kiểm tra xem MySQL đã bật chế độ ghi log nhị phân hay chưa bằng lệnh:

SHOW VARIABLES LIKE 'log_bin';

Nếu kết quả là 'ON', binlog đang được bật.

Liệt kê các tệp binlog:

SHOW BINARY LOGS;

Xem nội dung binlog:

tungnt@MacBook-Pro-cua-Nguyen-2 mysql % mysqlbinlog /opt/homebrew/var/mysql/binlog.000217
# The proper term IS pseudo_replica_mode, but we USE this compatibility alias
# TO make the statement usable ON server versions 8.0.24 AND older.
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#241021 13:19:55 server id 1  end_log_pos 127 CRC32 0x609227a3 	START: binlog v 4, server v 8.4.2 created 241021 13:19:55 at startup
# Warning: this binlog IS either IN USE OR was NOT closed properly.
ROLLBACK/*!*/;
BINLOG '
i/IVZw8BAAAAewAAAH8AAAABAAQAOC40LjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACL8hVnEwANAAgAAAAABAAEAAAAYwAEGggAAAAAAAACAAAACgoKKioAEjQA
CigAAAGjJ5Jg
'/*!*/;
# at 127
#241021 13:19:55 server id 1  end_log_pos 158 CRC32 0xcf101e2a 	Previous-GTIDs
# [empty]
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# END OF log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
development/database/mysql/debezium.1729757294.txt.gz · Last modified: 2024/10/24 08:08 by tungnt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki