I want to enable slow query logging in MySQL Galera.

In order to do so, I have enabled it through my.cnf:

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

Then, I tried to restart one server

sudo services mysql restart

The galera node fails to restart and writes to error.log:

mysqld_safe WSREP: Failed to recover position: 2015-08-29 12:07:37 27805 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 2015-08-29 12:07:37 27805 [Note] Plugin 'FEDERATED' is disabled. 2015-08-29 12:07:37 27805 [ERROR] Function 'innodb' already exists 2015-08-29 12:07:37 27805 ...

Once I remove the query logging from my.cnf, the server starts just fine and joins the cluster OK.

Is there a special procedure in enabling the query log in Galera? If so, how to do it?


If you are using Galera with MySQL 5.6, log_slow_queries was removed.

Here is what the MySQL 5.6 Documentation says on that option

The --log-slow-queries option was removed in MySQL 5.6.1 (along with the log_slow_queries system variable). 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.

Make you place the correct options under [mysqld] group header and not under [mysqld_safe]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.