user1128331
user1128331

Reputation: 727

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

Upvotes: 7

Views: 9817

Answers (3)

Ahmad Satiri
Ahmad Satiri

Reputation: 459

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';

Upvotes: 1

user1128331
user1128331

Reputation: 727

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"

Upvotes: 4

Sathish D
Sathish D

Reputation: 5034

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';

Upvotes: 5

Related Questions