MySQL log Files are generally stored in/var/log/mysqld. log. The following describes how to modify the location of MySQL log files for your reference.
Today, you need to change the location of the MySQL Log File and find that it cannot be changed in/etc/my. cnf.
It was found that the MySQL Log bit is specified:
[Root @ localhost etc] # ps aux | grep mysqld
Root 11830 0.5 0.0 4524 1204 pts/0 S/bin/sh/usr/bin/mysqld_safe -- datadir =/data/mysql -- socket =/var/lib/mysql. sock -- log-error =/var/log/mysqld. log -- pid-file =/var/run/mysqld. pid
Mysql 11890 3.7 0.1 40456 9076 pts/0 Sl/usr/libexec/mysqld -- basedir =/usr -- datadir =/data/mysql -- user = mysql -- pid-file =/ var/run/mysqld. pid -- skip-external-locking -- port = 3306 -- socket =/var/lib/mysql. sock
Root 11909 0.0 0.0 3908 664 pts/0 S + grep mysqld
Chkconfig -- list found to be specified by chkconfig on, day is
Vim/etc/init. d/mysqld it is known that the configuration
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. pid"
Mypidfile = "$ result"
Just change it here.