Home > Database > Mysql Tutorial > mysql日志文件在哪 如何修改MySQL日志文件位置

mysql日志文件在哪 如何修改MySQL日志文件位置

WBOY
Release: 2016-06-07 17:55:25
Original
1762 people have browsed it

MySQL日志文件相信大家都有很多的了解,MySQL日志文件一般在:/var/log/mysqld.log,下面介绍如何修改MySQL日志文件位置,需要的朋友可以参考下

MySQL日志文件相信大家都有很多的了解,MySQL日志文件一般在:/var/log/mysqld.log,下面就教您修改MySQL日志文件位置的方法,供您参考。

今天需要改MySQL日志文件的位置,发现在/etc/my.cnf中怎么也改不了。

后来发现MySQL日志位是指定的:

[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发现是chkconfig on指定的,天是

vim /etc/init.d/mysqld得知这里的已经配置

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"

更改这里应该就行了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template