2014-01-24 63 views
2

我已經在Mac OSX上通過Homebrew安裝了MySQL 5.6.15。在MySQL 5.6中啓用日誌可以防止服務器啓動

我已將以下行添加到my.cnf以啓用查詢日誌記錄,但MySQL服務器無法用新行重新啓動。我們如何解決這個問題?

添加到my.cnf文件

general_log=1 
log=/var/log/mysql-query.log 

錯誤:

Starting MySQL 
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/me-MacBook-Air.local.pid). 

整個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 

回答

0

報價從日誌文件的路徑缺失(可能對菜鳥有用)

,並在my.cnf具體的配置:

# General Query Log 
general_log=1 
general_log_file="/var/log/mysql-query.log" 
0

MySQL 5.6版本存在錯誤。 即使mysqld的顯示爲:

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 

檢查文件: 「C:\ ProgramData \ MySQL的\ MySQL服務器5.6 \ my.ini的」

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 

真的設置按照以下順序閱讀

希望它能幫助別人。