6

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?

1
  • did you ever come up with anything for this? Commented Oct 18, 2012 at 17:25

3 Answers 3

6

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

Sign up to request clarification or add additional context in comments.

2 Comments

We've looked at that a bit and that could work. The plan would be: 1) Change the port that MySQL listens on and then setup the on MySQL's old port. 2) Capture actions to our table and call some shell command. However, we'd much rather use <b>mysqlbinlog</b> in a <b>daemon</b> like way.
MySQL Proxy is not actively developed anymore. MySQL Router replaced it, with the similar functionality.
0

I am experimenting with using mysqlbinlog -R -t to get the feed in realtime, it works until the end, then you need to find the last position read, and continue there, combined with a query for log files this should give you all the files one after another.... am experimenting with this..

Comments

0

Also, if you want to know in real time if a change has taken place on one table, then i would suggest that you make a trigger on the master, and then you can insert data into a separate database that is replicated on its own. inside the trigger you can access another server even using a federated server. http://dev.mysql.com/tech-resources/articles/mysql-federated-storage.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.