I am having trouble to activate general logs in mysql since version 5.6.

What is the proper way to do it ?


Here is how I managed to do it :

  1. Edit your /etc/mysql/my.cnfand add the following at the end of the file :

    general_log_file = /var/log/mysql/mysql.log
    general_log = 1
  2. Connect through mysql (mysql -u <username> -p) and run :

    SET GLOBAL general_log = 1;
  3. 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 
| improve this answer | |
  • 2
    Should be SET GLOBAL general_log = 1; as mysq gives an error – stephen Aug 22 '16 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.