Cannot include shared MySql query log file on wamp running mysql 5.6

I am having trouble activating a shared query log file in WAMP. I looked at a lot of threads and can't get him to write a log.

I tried both good queries and bad queries to try to disable the log.

Any suggestions?

This is my my.ini

# The MySQL server
[wampmysqld]
port        = 3306
socket      = /tmp/mysql.sock
key_buffer_size = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
basedir=c:/wamp/bin/mysql/mysql5.6.17
log-error=c:/wamp/logs/mysql.log
datadir=c:/wamp/bin/mysql/mysql5.6.17/data
log-output = FILE
general-log = 1
general_log_file=C:/wamp/logs/general-query.log
+4
source share
1 answer

You have a typo in general-log. It should begeneral_log

And then restart mysql.

And check your variables after restart, e.g.

select @@general_log; -- 0 (that means OFF). 1 is ON.
select @@general_log_file; -- GUYSMILEY.log
select @@datadir; -- C:\ProgramData\MySQL\MySQL Server 5.6\Data\
select @@version; -- 5.6.31-log

To set a dynamic variable to override the cnf or ini parameter, do something similar to:

set GLOBAL general_log=1;

enter image description here

, datadir, basedir. , Windows, \ProgramData, , datadir.

, , sql . .

. . , . , , , , . , .

. Gryphius.

( ).

, cnf ini. , reset mysql.

, , . , . , 3 4 :

show variables like '%error%';
show variables like '%slow%';

log_error -- string for filename

slow_query_log -- set to 'ON' or 1, 'OFF' or 0
slow_query_log_file; --- string for filename

show variables;

. long_query_time , . , 0 10. Percona , .

select @@long_query_time;
+-------------------+
| @@long_query_time |
+-------------------+
|         10.000000 |
+-------------------+

: SET GLOBAL stmt. , cnf ini. :

select @@slow_query_log; -- to see current value
select @@slow_query_log_file; -- to see current value (file in datadir)
select @@datadir; -- to see current value

set global slow_query_log=0; -- Turn Off
-- make a backup of it with a move and rename (See Note1) to a folder below datadir
set global slow_query_log=1; -- Turn it back On (new empty file is created)

1: , Note1. .

+4

Source: https://habr.com/ru/post/1649814/


All Articles