소스 검색

added file database-query-logging.md

Marius Schwarz 5 년 전
부모
커밋
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`
+
+