Bug #82468 When log_slow_queries option is enabled, mysqld does not start.
Submitted: 5 Aug 2016 8:26 Modified: 5 Aug 2016 9:19
Reporter: Lee ed Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Logging Severity:S2 (Serious)
Version:mysql Ver 14.14 Distrib 5.7.13, for Lin OS:Ubuntu (Linux mars 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Lin)
Assigned to: CPU Architecture:Any
Tags: log_slow_queries option, startup

[5 Aug 2016 8:26] Lee ed
Description:
When I enabled 'log_slow_queries' option, mysqld does not start.

How to repeat:
Following is my 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

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * Basic Settings
#
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 127.0.0.1
#
# * Fine Tuning
#
key_buffer_size		= 512M
max_allowed_packet	= 16M
thread_stack		= 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options  = BACKUP
#table_cache            = 64
#thread_concurrency     = 10

#my config
#innodb_lock_wait_timeout = 1000
#transaction-isolation           = READ-COMMITTED
#max_heap_table_size = 256000000
#tmp_table_size = 256000000
#sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
#table_open_cache = 20000
#max_connections        = 3000

#
# * Query Cache Configuration
#
query_cache_limit	= 4M
query_cache_size        = 512M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
log_slow_queries	= /var/log/mysql/mysql-slow.log
long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#log_bin			= /var/log/mysql/mysql-bin.log
expire_logs_days	= 10
max_binlog_size   = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
--------------------------------------

Next, I started mysql service as this...
# service mysql restart

The result is ...
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

So, I typed 'systemctl status mysql.service', then the message is ...
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Fri 2016-08-05 17:10:31 KST; 14s ago
  Process: 28633 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 28629 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 28633 (code=exited, status=1/FAILURE);         : 28634 (mysql-systemd-s)
    Tasks: 2
   Memory: 576.0K
      CPU: 290ms
   CGroup: /system.slice/mysql.service
           └─control
             ├─28634 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─28688 sleep 1

Aug 05 17:10:31 mars systemd[1]: Starting MySQL Community Server...
Aug 05 17:10:33 mars systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

Suggested fix:
MySql service should be started without any errors.
[5 Aug 2016 8:56] MySQL Verification Team
The --log-slow-queries option is deprecated and is removed (along with the log_slow_queries system variable) in MySQL 5.6 and above. Instead, use the --slow_query_log option to enable the slow query log and the --slow_query_log_file=file_name option to set the slow query log file name.

Please refer http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_log-slow-queries

Thank you for your interest in MySQL.
[5 Aug 2016 9:19] Lee ed
Ok, But, I want ask some question. Why do you leave 'log_slow_queries' in default my.cnf file?. Do you want anyone like me to be faced this situation when uncommented the log_slow_queries option line in the config file?. And he/she produce a bug report like this?
Good design and good implementation, but bad finish.