0

I am trying to have mysql transaction logging goto a script and the from the script I am writing the file to two locations (one mapped remote) for basic redundancy and possibly for extension/specialized parsing later.

With some applications I am able to use a pipe to the script i.e. --log="|/usr/local/bin/processScript"

MySQL however complains it is not able to find the file even with 755 permissions on the script.

I have also looked at FIFO files but I am not sure if they can do what I want to do. I really don't want to use any form of polling system.

Any ideas on what might be going on, or how to achieve this?

Joshua Enfield
  • 3,454
  • 8
  • 42
  • 59

3 Answers3

0

i dont think it's possible. for redundancy - why don't you use regular mysql replication to other mysql servers located locally & offsite [with binlog to file enabled on them ... so you have the data even in case someone executes the dreaded drop table command ]?

pQd
  • 29,981
  • 6
  • 66
  • 109
  • Redundancy isn't the only reason. Might want to parse it into a different format at some point on the fly. – Joshua Enfield Mar 07 '11 at 22:10
  • @Joshua Enfield - then - i'm affraid text logging and live tail'ing it or parsing of binlogs are your only options. – pQd Mar 07 '11 at 22:22
0

Never seen a the logfile defined as a pipe before. Sure you can do that?

Also have you considered using binary logging? Much quicker! But means you have to deal with binary logs not plain text - the mysqlbinlog command will do most the work though.

Coops
  • 6,055
  • 1
  • 34
  • 54
  • Yes, it's worked for other applications see http://serverfault.com/questions/157044/linux-centos-is-there-any-feasible-way-to-add-a-file-write-hook – Joshua Enfield Mar 07 '11 at 22:49
0

Using |/path/to/some/script syntax for output destination is application specific. Some applications support may it. MySQL manual says nothing about supporting this syntax, so probably it is not supported.

For redundancy you should use MySQL built-in replication. Additionally, you could enable log-slave-updates option and extract executed queries from binlog on slave using mysqlbinlog.

Another posibility is setting up DRBD replication on volume, where mysql general log is stored.

sumar
  • 2,106
  • 12
  • 12