slow query log in default my.cnf (Debian package)

Bug #1617451 reported by Jeff Palmer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Triaged
Low
Unassigned
5.6
Triaged
Low
Unassigned
5.7
Invalid
Undecided
Unassigned

Bug Description

The default my.cnf in the debian includes the following:

# Here you can see queries with especially long duration
# log_slow_queries = /var/log/mysql/mysql-slow.log

However, the actual config syntax has changed. If you simply uncomment the line included in the default config, percona server will fail to start.

The new syntax is:

slow_query_log = 1

Unfortunately, even though I've run into this numerous times, it still catches me every single time I set up a new server. Please update the default configs.

P.S. I've only checked the debian packages for 5.5 and 5.6, I have not checked the source tarball, rpm's or other installation methods, nor 5.7.

Changed in percona-server:
assignee: nobody → Muhammad Irfan (muhammad-irfan)
Revision history for this message
Muhammad Irfan (muhammad-irfan) wrote :

I'm able to reproduce this problem for Percona Server 5.6 on Debian Wheezy. I installed Percona Server 5.6 through apt and in my.cnf it used deprecated slow log variable log_slow_queries although commented.

tags: added: pkg
Revision history for this message
Muhammad Irfan (muhammad-irfan) wrote :
Download full text (3.3 KiB)

I tried with Percona Server 5.5.55 via yum install on debian wheezy and I found really strange behavior.

mysql> show global variables like '%version%';
+-------------------------+------------------------------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------------------------------+
| innodb_version | 5.5.55-38.8 |
| protocol_version | 10 |
| slave_type_conversions | |
| tls_version | TLSv1.1,TLSv1.2 |
| version | 5.5.55-38.8-log |
| version_comment | Percona Server (GPL), Release 38.8, Revision 11f5bbd |
| version_compile_machine | x86_64 |
| version_compile_os | debian-linux-gnu |
+-------------------------+------------------------------------------------------+

I un-commented below line from default my.cnf

log_slow_queries = /var/log/mysql/mysql-slow.log

After Percona Server restart

mysql> show global variables like '%slow%';
+------------------------------------+-------------------------------+
| Variable_name | Value |
+------------------------------------+-------------------------------+
| log_slow_admin_statements | OFF |
| log_slow_filter | |
| log_slow_queries | ON |
| log_slow_rate_limit | 1 |
| log_slow_rate_type | session |
| log_slow_slave_statements | OFF |
| log_slow_sp_statements | ON |
| log_slow_verbosity | |
| max_slowlog_files | 0 |
| max_slowlog_size | 0 |
| slow_launch_time | 2 |
| slow_query_log | ON |
| slow_query_log_always_write_time | 10.000000 |
| slow_query_log_file | /var/log/mysql/mysql-slow.log |
| slow_query_log_timestamp_always | OFF |
| slow_query_log_timestamp_precision | second |
| slow_query_log_use_global_control | |
+------------------------------------+-------------------------------+
17 rows in set (0.00 sec)

Slow query log enabled despite of it's disabled from slow log. Further, log_slow_queries should accept ON|OFF bit instead showing value for slow_query_log_file. Other than that, log_slow_queries should be removed completely as slow_query_log is the correct parameter to enable slow log. I'm going to open new bug report for this and this is true for up...

Read more...

Revision history for this message
Muhammad Irfan (muhammad-irfan) wrote :

From https://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_log-slow-queries

"The --log-slow-queries option is deprecated and is removed (along with the log_slow_queries system variable) in MySQL 5.6. 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."

Most probably MySQL 5.5 didn't failed with "log_slow_queries" when enabled through my.cnf because "log_slow_queries" is valid in 5.5 version but still my.cnf shouldn't contain below line.

log_slow_queries = /var/log/mysql/mysql-slow.log

And another thing it should be reflecting to value "ON|OFF" instead value for "slow_query_log_file" parameter.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3534

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.