1

I'm using 10.4.10-MariaDB with Webmin. i'm getting the error "/usr/bin/mysql: unknown variable 'slow_query_log=1'"

I added the below in my.cnf and the error occured

slow_query_log = 1
long_query_time = 3
slow_query_log_file = /var/log/mariadb/slow-query.log
cilapo1541
  • 53
  • 2
  • 6

2 Answers2

2

As Michael Hampton pointed out, you almost certainly have slow_query_log in the wrong section or the wrong file. One can have multiple my.cnfs, and each my.cnf is laid out as an INI file, with each command picking up different section(s); for example, [client] is ignored by mysqld, but is read by mysqldump, and then overridden by any settings supplied in [mysqldump].

For slow_query_log, you usually would want that in the [mysqld] section of your server-level my.cnf. Including it in your user my.cnf (i.e., ~/.my.cnf) will have no effect whatsoever, as the server is what needs to read it.

BMDan
  • 7,249
  • 2
  • 23
  • 34
0

Gotta put the configs under [mysqld] section in my.cnf file. Like

[mysqld]
slow_query_log = 1
long_query_time = 3
slow_query_log_file = /var/log/mariadb/slow-query.log
cilapo1541
  • 53
  • 2
  • 6