1

I am using here MySQL 5.7.19 from Oracle in Debian Jessie and Stretch.

ps ax | grep mysql
/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=syslog.srv.rede.err --pid-file

I would like to take out the --log-error parameter from it, and replace it with --syslog.

Somewhat when reading the associate boot scripts I got the (wrong?) idea the parameters were being built from the configuration files, and I replaced in /etc/mysql/mysql.conf.d/mysqld.conf the line

log-error      = /var/log/mysql/error.log

for

syslog

I restarted the mysql service, and it did not work as expected.

How can I configure logging to syslog in a "Debian way"?

EDIT: I opened the question in the spirit of finding it out about alternative ways besides editing init scripts

  • 1
    This would be the "Oracle way" as you cannot be using a Debian-packaged MySQL. The latest available Debian-packaged version as I write this is 5.7.18, and one has to go to "testing" for that. Debian 8 has MySQL 5.5. Oracle does not package things the same way that Debian does. The van Smoorenburg rc scripts and service units are quite different. Indeed, it even does not package things in just one way itself. – JdeBP Sep 5 '17 at 3:42
  • @JdeBP At the time I migrated, and mid-life Jessie, it made sense. Nowadays with the advancements in MariaDB, not so much. However it is indeed a way to have a more recent MySQL version. – Rui F Ribeiro Sep 5 '17 at 7:16
1

Running sudo service mysql restart will execute /etc/init.d/mysql. Consider editing that script. You'll want to pay attention to the output of:

$ mysqld --print-defaults
  • +1 The answer is technically correct because I forgot to mention explicitly I do not want to do that. Actually I know which associated init script I have to edit and where to change, just pooling collective knowledge if there is a cleaner way. I already have done that in my BIND and DHCP servers, and have diversions on place. – Rui F Ribeiro Sep 5 '17 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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