Reputation: 13739
I'm having trouble enabling local query logging for MariaDB. In the C:\WAMP\MariaDB\data\my.ini
file I have the following:
[mysqld]
datadir=C:/WAMP/MariaDB/data
port=3306
innodb_buffer_pool_size=2014M
character-set-server=utf8
general_log = 1
long_query_time = 1
slow_query_log = 1
log = "C:/WAMP/MariaDB/logs/queries.log"
However no matter what I do the log
key prevents MariaDB from starting. I've moved it around to different parts of the config file and it has no effect, a site that very clearly uses a database and would generate queries should be updating that file though wasn't.
In short, without mentioning the former MariaDB is based upon, how do I enable general query logging for MariaDB?
Upvotes: 1
Views: 4007
Reputation: 18960
Actually, this is documented here: General Query Log
The general query log is disabled by default. Since it's a record of every query received by the server, it can grow large quite quickly. If you only want a record of queries that change data, rather use the binary log instead.
Example of how to log to file:
By adding this to your my.cnf file all queries will be logged to the file queries.log in the datadir
directory.
[mariadb]
log_output=FILE
general_log
general_log_file=queries.log
Upvotes: 1
Reputation: 13739
I was able to minimize the working code to the following (last two lines):
[mysqld]
datadir=C:/MEDIA/INTERNET/WAMP/MariaDB/data
port=3306
innodb_buffer_pool_size=2014M
character-set-server=utf8
general-log
general-log-file=C:/WAMP/MariaDB/logs/queries.log
Upvotes: 0
Reputation: 3987
The log
option was deprecated in 5.x releases and removed in 10.0. Apparently you are running a 10.x version of the server.
To set the path/name of the general log, you need to use general_log_file
option instead.
Or, if you are trying to set the location of the error log, then the option name is log_error
.
Upvotes: 3