How to modify the MySQL log file location

Source: Internet
Author: User
Tags socket

MySQL log files believe that we all have a lot of understanding, MySQL log files in general:/var/log/mysqld.log, the following teach you to modify the MySQL log file location method for your reference.

Today need to change the location of the MySQL log file, found in the/etc/my.cnf can not be changed.

The MySQL log bit was later found to be specified:

[Root@localhost etc]# PS aux|grep mysqld

Root 11830 0.5 0.0 4524 1204 pts/0 S-03:03 0:00/bin/sh/usr/bin/mysqld_safe--datadir=/data/mysql--socket=/var/lib/mysql /mysql.sock--log-error=/var/log/mysqld.log--pid-file=/var/run/mysqld/mysqld.pid

MySQL 11890 3.7 0.1 40456 9076 pts/0 Sl 03:03 0:00/usr/libexec/mysqld--basedir=/usr--datadir=/data/mysql--user=mysql- -pid-file=/var/run/mysqld/mysqld.pid--skip-external-locking--port=3306--socket=/var/lib/mysql/mysql.sock

Root 11909 0.0 0.0 3908 664 pts/0 s+ 03:03 0:00 grep mysqld

Chkconfig--list Discovery is chkconfig on specified, day is

Vim/etc/init.d/mysqld learned that this place has been configured

Get_mysql_option mysqld datadir "/var/lib/mysql"

Datadir= "$result"

Get_mysql_option mysqld Socket "$datadir/mysql.sock"

Socketfile= "$result"

Get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"

Errlogfile= "$result"

Get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"

Mypidfile= "$result"

It should be okay to change this.

Related Article

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.