2

I'm trying to set my general log file to a fifo named pipe and am getting an error

$ sudo mkfifo -m 0666 general.fifo

mysql> set global general_log_file='/var/log/mysql/dradis/general.fifo';
ERROR 1231 (42000): Variable 'general_log_file' can't be set to the value of '/var/log/mysql/dradis/general.fifo'

mysql> \! ls -l /var/log/mysql/dradis/general.fifo
prw-rw-rw- 1 root root 0 Nov 27 14:27 /var/log/mysql/dradis/general.fifo

Version I'm running 5.6.20-68.0-log Percona Server.

How can I make this work?

atxdba
  • 5,293
  • 5
  • 41
  • 62

1 Answers1

1

It looks like it should work because the general_log_file is dynamic (according to the MySQL Documentation).

Some six(6) years ago, Joel Hanger answered How do I output MySQL logs to syslog?. In his answer, he added it to the my.cnf. Evidently, a mysqld restart would be needed.

In your particular case, you may have to enable the general log first using

SET GLOBAL general_log = 1;

to initiate a general log with the default name of hostname.log.

This will create an open file handle. You may then have to try setting the general_log_file with general_log on and off. You may also have to run FLUSH LOGS; to force the closing and reopening of log file handles.

This answer is just a lazy guess, so try it and see.

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536