浏览代码

added file database-query-logging.md

Marius Schwarz 4 年之前
父节点
当前提交
91bc97b371
共有 1 个文件被更改,包括 34 次插入0 次删除
  1. 34 0
      cheatsheets/security/reversing/fatclients/database-query-logging.md

+ 34 - 0
cheatsheets/security/reversing/fatclients/database-query-logging.md

@@ -0,0 +1,34 @@
+---
+title: Database Query Logging
+categories: [cheatsheets]
+tags: [topic]
+---
+
+# Database Query Logging
+
+## MySQL & MariaDB
+
+* Uncomment the following lines in the MySql configuration file:
+
+```
+general_log_file        = /var/log/mysql/mysql.log
+general_log             = 1
+```
+
+* File location: `/etc/mysql/my.conf`
+* Restart SQL: `systemctl restart mysql`
+* Watch Logs: `sudo tail -f /var/log/mysql/mysql.log`
+
+
+## Postgresql
+
+* Change the `log_statement` to `all`, as seen below:
+
+```
+log_statement = 'all' # none, ddl, mod, all
+```
+
+* File location Windows: `<application>\pgsql\data\<db>\postgresql.conf`
+* File location Linux: `/etc/postgresql/<version>/main/postgresql.conf`
+
+