无法在MySQL中启用日志 - 错误:在配置文件中找不到前一组的选项

hg8*_*hg8 9 mysql ubuntu mysql-5.6 ubuntu-15.04

我试图在我的MySQL服务器上启用日志,但没有成功.我做了什么 :

1)我创建了具有正确权限的日志文件:

touch /var/log/mysql/mysql.log   
chown mysql:mysql /var/log/mysql/mysql.log
Run Code Online (Sandbox Code Playgroud)

2)我已将所需的更改添加到my.cnf文件中:

general_log_file        = /var/log/mysql/mysql.log
general_log             = 1
Run Code Online (Sandbox Code Playgroud)

我的my.cnf文件如下:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

general_log_file        = /var/log/mysql/mysql.log
general_log             = 1
Run Code Online (Sandbox Code Playgroud)

我无法重启MySQL,当我尝试登录时,我有这个错误:

错误:在配置文件中找到没有前面组的选项:/etc/mysql/my.cnf at line:23默认处理中出现致命错误.程序中止

这意味着什么以及如何解决这个问题?

我正在使用Ubuntu 15.05MySQL 5.6.24-0ubuntu2

jua*_*nra 23

也许您应该将[mysqld]添加为my.cnf文件的第一行.