hg8 Asked: 2015-11-20 02:46:10 +0800 CST2015-11-20 02:46:10 +0800 CST 2015-11-20 02:46:10 +0800 CST How to activate MySQL general log in version >= 5.6? 772 I am having trouble to activate general logs in mysql since version 5.6. What is the proper way to do it ? mysql 1 Answers Voted Best Answer hg8 2015-11-20T02:46:10+08:002015-11-20T02:46:10+08:00 Here is how I managed to do it : Edit your /etc/mysql/my.cnfand add the following at the end of the file : [mysqld] general_log_file = /var/log/mysql/mysql.log general_log = 1 Connect through mysql (mysql -u <username> -p) and run : SET GLOBAL general_log = 1; Restart mysql : sudo service mysql restart Note : If general log is still not working, try to manually create the log file : touch /var/log/mysql/mysql.log sudo chown mysql:mysql /var/log/mysql/mysql.log
Here is how I managed to do it :
Edit your
/etc/mysql/my.cnf
and add the following at the end of the file :Connect through
mysql
(mysql -u <username> -p
) and run :Restart
mysql
:Note :
If general log is still not working, try to manually create the log file :