we are dealing with a legacy application built on MySQL 5.0 (MyISAM). I need to know in real-time when an update, delete, or insert happens to a particular table. The 'gotcha' is that I can't change the db (i.e. write triggers) in any way. I have to use the bin log, replication or something else which is somewhat non-invasive.
We've looked at using the 'mysqlbinlog' command to parse the binary log. However, this is not real-time and we'd rather do something more event driven.
Any ideas?
You can use mysqlbinlog to read binary log files directly and apply them to the local MySQL server. You can also read binary logs from a remote server by using the --read-from-remote-server option. To read remote binary logs, the connection parameter options can be given to indicate how to connect to the server.
Enabling the binary logs MySQL binary logs can be enabled or disabled by adding or removing the log-bin configuration option. The log-bin parameter is in the configuration files named my. ini. When we install MySQL Server, the configuration file is created in C:\ProgramData\MySQL\MySQL Server 8.0 directory.
The binary log is a set of log files that contain information about data modifications made to a MySQL server instance. The log is enabled by starting the server with the --log-bin option. The binary log was introduced in MySQL 3.23.
To safely purge binary log files, follow this procedure: On each replica, use SHOW REPLICA STATUS to check which log file it is reading. Obtain a listing of the binary log files on the source with SHOW BINARY LOGS . Determine the earliest log file among all the replicas.
check MySQL Proxy. it lets you tap right in the command/response stream, and it's fully programmable in Lua. you can even modify commands in real time, if you want
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With