You have a typo in general-log
. It should be general_log
And then a mysql restart.
And check your variables, after a restart such as
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 a cnf or ini file setting, do something similar to:
set GLOBAL general_log=1;

Remember that it is datadir
, not basedir
. You may need to open up the viewing of hidden folders on Windows to see the \ProgramData
if that is where you datadir
points.
And lastly, you don't need to trick it with an error sql statement. The General Query Log is for all queries.
For a screenshot view of it, see This Answer. Remember, it is for all queries. So turn it off, make a copy, delete, turn back on, it regenerates. Don't forget too that having the General Log activated in production slows down performance.
Also, see this answer from Gryphius.
Edit (per your question in comments).
Changes to dynamic variables are fleeting if not mirrored in cnf or ini settings. Meaning, they are reset upon mysql restarting.
I don't know a way to turn off Error logging nor would I probably want to. Errors are infrequent and knowledge of them is quite important. So the below should satisfy 3 of your 4 curiosities:
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
Then there is always show variables;
More on the slow query log. If you set the long_query_time
high enough, it will effectively filter out more noise. It is in seconds, from 0 to 10. And a Percona article though dated.
select @@long_query_time;
+-------------------+
| @@long_query_time |
+-------------------+
| 10.000000 |
+-------------------+
Note, I can't seem to set the above with a SET GLOBAL
stmt. So it appears to be a setting only for the cnf or ini file. But you can do the following:
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)
Note1: Image of file copied, renamed at Note1 point-in-time above. Image Here.