我无法为MariaDB启用本地查询日志记录 . 在 C:\WAMP\MariaDB\data\my.ini
文件中,我有以下内容:
[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"
但无论我做什么, log
键都会阻止MariaDB启动 . 我'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 .
简而言之,如果不提前MariaDB是基于的,我如何为MariaDB启用通用查询日志记录?
3 回答
我能够将工作代码最小化到以下(最后两行):
log
选项在5.x版本中已弃用,在10.0中已删除 . 显然你正在运行10.x版本的服务器 . 要设置常规日志的路径/名称,需要使用general_log_file option .或者,如果您尝试设置错误日志的位置,则选项名称为log_error .
实际上,这里有记录:General Query Log
如何登录文件的示例:
通过将此添加到my.cnf文件中,所有查询都将记录到datadir目录中的query.log文件中 .