The log
option is deprecated since 5.6.1, and you're using 5.6.15.
Use general_log_file
instead:
general_log_file=/var/log/mysql-query.log
Question
I've installed MySQL 5.6.15 on Mac OSX via Homebrew.
I've added the following lines to my.cnf
to enable query logging, but the MySQL server is unable to restart with the new lines. How can we solve the problem?
Added to my.cnf
general_log=1
log=/var/log/mysql-query.log
Error:
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/me-MacBook-Air.local.pid).
Entire my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
general_log=1
log=/var/log/mysql-query.log
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Solution
The log
option is deprecated since 5.6.1, and you're using 5.6.15.
Use general_log_file
instead:
general_log_file=/var/log/mysql-query.log
OTHER TIPS
Quotes are missing from the path to log file (May be helpful for noobs)
and the exact configuration in my.cnf is:
# General Query Log
general_log=1
general_log_file="/var/log/mysql-query.log"
There is bug in MySQL 5.6 version. Even mysqld show as :
Default options are read from the following files in the given order:
C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf c:\Program Files (x86)\MySQL\MySQL Server 5.6\my.ini c:\Program Files (x86)\MySQL\MySQL Server 5.6\my.cnf
Realy settings are reading in following order :
Default options are read from the following files in the given order:
C:\ProgramData\MySQL\MySQL Server 5.6\my.ini C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf c:\Program Files (x86)\MySQL\MySQL Server 5.6\my.ini c:\Program Files (x86)\MySQL\MySQL Server 5.6\my.cnf
Check file: "C:\ProgramData\MySQL\MySQL Server 5.6\my.ini"
Hope it help somebody.