mysql - 在 MySQL 5.6 中启用日志会阻止服务器启动

标签 mysql macos homebrew mysql-5.6

我已经通过 Homebrew 在 Mac OSX 上安装了 MySQL 5.6.15。

我已将以下行添加到 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 

最佳答案

log 选项是 deprecated since 5.6.1 ,并且您使用的是 5.6.15。

使用general_log_file相反:

general_log_file=/var/log/mysql-query.log

关于mysql - 在 MySQL 5.6 中启用日志会阻止服务器启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21327975/

相关文章:

mysql 替换表中的值

mysql - 在 MYSQL 中连接多个表时出现错误(

xml - 是否可以从 Mac OS 使用 XSD 工具?

homebrew - brew 清理的警告

python - 使用 brew 安装 Pyqt4

ruby-on-rails - 在OS X 10.9上安装OpenCV失败

mysql - 查询以查找 SQL Server 的状态

mysql - 如何删除每列中只有空值的行?

macos - 如何在 NSPopupButton 项目中显示图像和文本

objective-c - 日历 将事件位置存储到数组对象