Output MySQL logs to syslog In the chroot environment

Source: Internet
Author: User
Tags syslog
One problem we encountered in the past two days is that after our product is provided to the customer, the customer needs to manage the logs in a unified manner. To output the logs to syslog, MySQL needs to [mysqld_safe] In my. cnf

One problem we encountered in the past two days is that after our product is provided to the customer, the customer needs to manage the logs in a unified manner. To output the logs to syslog, MySQL needs to [mysqld_safe] In my. cnf

I have been learning nodejs and angularjs over the past few months. I am still working on front-end development. I will share some experiences later.

One problem we encountered in the past two days is that after our product is provided to the customer, the customer needs to manage the logs in a unified manner. MySQL needs to output the logs to syslog in my. configure syslog in the [mysqld_safe] section of cnf. However, after modification, it is found that the service fails to start and there is no log. After several surveys, you still need to do the following:

1. Copy/bin/logger to chroot jail during chroot MySQL. Because logger is the shell Interface of syslog, syslog cannot be called without the executable file of logger.

2. generally, logger sends logs to the/dev/log socket, but in the chroot environment, jail cannot access external files, therefore, you need to configure the log socket file in chroot jail by modifying/etc/sysconfig/syslog and changing SYSLOGD_OPTIONS

SYSLOGD_OPTIONS = "-m 0-a/var/chroot/mysql/dev/log"

Man says this:

-A socket

Using this argument you can specify additional sockets from that syslogd has to listen to. This is needed if you're going to let some

Daemon run within a chroot () environment. You can use up to 19 additional sockets.

Okay. Restart syslog. MySQL logs are output to/var/log/daemon by default. the log file is in the/var/chroot/mysql/dev directory.

Above, passed the test in CentOS 5.9

-------------------------------------- Split line --------------------------------------

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

MySQL-5.5.38 universal binary Installation

-------------------------------------- Split line --------------------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.