# How to enable MySQL Query Log?

MySQL query log stores the history of executed queries. This history is stored
in a log file. On busy servers, this file ca grow very large.

To enable the query log, put the following line into `/etc/my.cnf` file in
the `[mysqld]` section:

```bash
general_log_file = /path/to/query.log
general_log      = 1
```

Alternatively, you can do this at runtime by running the following MySQL
commands:

```sql
SET GLOBAL log_output = "FILE";
SET GLOBAL general_log_file = "/path/to/your/logfile.log";
SET GLOBAL general_log = 'ON';
```

Don’t forget to replace the `"/path/to/your/logfile.log"` with the path to the
actual log file you wish to store the logs.

Then you can see the logs in the `/path/to/your/logfile.log` file.
