Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What version of MySQL? 5.0 (Surprisingly common version)? 5.1? –  Stefan Lasiewski Mar 7 '11 at 21:07
    
5.0.77 is the version. –  Joshua Enfield Mar 7 '11 at 22:50

3 Answers 3

up vote 0 down vote accepted

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.

share|improve this answer

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 ]?

share|improve this answer
    
Redundancy isn't the only reason. Might want to parse it into a different format at some point on the fly. –  Joshua Enfield Mar 7 '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 7 '11 at 22:22

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.

share|improve this answer
    
Yes, it's worked for other applications see serverfault.com/questions/157044/… –  Joshua Enfield Mar 7 '11 at 22:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.