简体   繁体   中英

mysql: turn on the general log

I try to turn on the general log on the mysql I use the xampp as the local server and this is my.ini

log_output = FILE
general_log = 1
general_log = "mysql_query.log"

I can't find the file at all, please help

where is log located?

mysql> SHOW variables like '%general_log%';

+------------------+--------------------+
| Variable_name    | Value              |
+------------------+--------------------+
| general_log      | ON                 |
| general_log_file | /tmp/your_path.log |
+------------------+--------------------+

you want change location?

mysql> SET GLOBAL general_log_file = 'file name';

I type it wrong XD

it should be...

general_log = 1
general_log_file = "mysql_query.log"

and don't forget to check log_output variable to be "FILE"

just found the answer, probably will help someone

https://dev.mysql.com/doc/refman/5.1/en/query-log.html as root

SET GLOBAL general_log = 'ON';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM