0

I have a running mysql system that doesn't have any logging turned on.

How do I enable the logging without restarting the server? I need to find out why mysql replication is failing.

BTW. I tried /etc/init.d/mysqld reload

But reload wasn't a valid option.

This system is running telephones so restarting it will most likely drop calls which I can't afford to do.

Also tried at the mysql command prompt set log_error='/var/log/mysql/error.log' but it came back and said there was no such system variable. Yet show variables lists it.

hookenz
  • 14,132
  • 22
  • 86
  • 142

2 Answers2

1

log-error isn't a dynamic system variable. If you need to change it, you're going to have to restart.

I find it difficult to believe that it isn't logging. This setting is specified via two methods. The first is at run time with --log-error=filename, which would often be specified in your init file. More commonly, it would be specified in your my.cnf with log-error. Ultimately if left unset, it defaults to the data directory as your hostname.err.

Search the filesystem for a file with the extension of .err. Chances are, you'll find the log.

find / -name '*.err'
locate .err | egrep '.err$'

Warner
  • 23,440
  • 2
  • 57
  • 69
0

If slave replication is failing you can see the errors on the slave without enabling logging and restarting the instance on the master.

Log into the slave instance of MySQL and do a

mysql > show slave status;

That should show you the last error message, from which you should be able to determine the action to fix it.

Alternatively enable logging on the slave and see the queries and errors there.

Richard Holloway
  • 7,256
  • 2
  • 24
  • 30