2015-05-10 04:34:55 -05:00
|
|
|
# Log executed SQL commands in MySQL/MariaDB
|
|
|
|
|
|
|
|
> Don't know where MySQL config file is? check this tutorial:
|
2016-02-10 06:05:52 -06:00
|
|
|
> [Locations of configuration and log files of major components](file.locations.html#mysql-mariadb).
|
2015-05-10 04:34:55 -05:00
|
|
|
|
|
|
|
To log executed SQL commands, please add below two settings in MySQL/MariaDB
|
|
|
|
config file `my.cnf`:
|
|
|
|
|
|
|
|
```
|
|
|
|
[mysqld]
|
|
|
|
general_log = 1
|
|
|
|
general_log_file = /var/log/mysql.log
|
|
|
|
```
|
|
|
|
|
|
|
|
Then restart MySQL/MariaDB service.
|
|
|
|
|
|
|
|
Note: MySQL/MariaDB daemon user must have permission to write this log file.
|