[CentOS] mysql query logging

A. Kirillov nevis2us at infoline.su
Sat Sep 12 06:45:05 UTC 2009


> # cat /etc/my.cnf
> [mysqld]
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> user=mysql
> # Default to using old password format for compatibility with mysql 3.x
> # clients (those using the mysqlclient10 compatibility package).
> old_passwords=1
> max_allowed_packet=2MB
> 
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
> log-query=/var/log/mysql-query.log
> 
> empty
> 
> and then I added to /etc/init.d/mysqld
> 
> get_mysql_option mysqld_safe log "/var/log/mysqld-query.log"
> querylogfile="$result"
> -and-
> start(){
>         touch "$querylogfile"
>         chown mysql:mysql "$querylogfile"
>         chmod 0640 "$querylogfile"
> 
> but nothing is logged.

Try to put
log=/var/log/mysqld.log
into [mysqld] section of my.cnf

HTH
Sasha





More information about the CentOS mailing list