Adamski
Adamski

Reputation: 889

MariaDB 10.1.22 on Mac OSX 10.2 - Enable the general query log in my.cnf

I have MariaDB 10.1.22 installed on Mac OSX 10.2.

my.cnf is located in /usr/local/etc/my.cnf (it does use that file).

This is an example of my default my.cnf

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /usr/local/etc/my.cnf.d

If I add the following line:

general_log = 1

or:

general-log = 1

I restart mysql and it fails with the following output:

unknown variable 'general_log=on'

or:

unknown variable 'general-log=on'

I have researched this on the mariadb site and it tells me to use the 'general_log' syntax, However that does not work.

I have noticed that the 'group':

[client-server]

is read by both client and server, Could that be the issue? If so what is the correct syntax to enable the general log within my.cnf?

Thanks in advance.

UPDATE: When I attempt to add another group for example the 'mysql' group:

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[mysqld]
general-log = 1
#[client-server]
#!includedir /usr/local/etc/my.cnf.d

I then restart the mysql server and I receive the following output error:

ERROR 1049 (42000): Unknown database 'restart'

This happens when I enter '[mariadb]' too. Incorrect group tags maybe?

Upvotes: 0

Views: 351

Answers (1)

elenst
elenst

Reputation: 3987

general-log option should be added to [mysqld] section or [mariadb] section of the config file (you can create one if they're not there):

[mysqld]
general-log = 1

Clients don't recognize it. The startup probably runs mysql or mysqladmin which pick up the config option and throw the error.

Upvotes: 0

Related Questions