Enabling MySQL logs for version 5.6
I'm having some issues where my MySQL database becomes corrupted, and I don't have any logs to help me see where and how the problem may be occurring. Any idea how I might enable some logs for this service?
You should be able to enable logging for your MySQL database by making a few different configuration changes on your Linode. The first would be to edit your
my.cnf file. You should be able to open this file with a text-editor of your choice, however I'm using nano in the example below:
sudo nano /etc/my.cnf
From there, you'll just want to add the following parameters to your configuration:
general_log = on general_log_file=/var/log/mysql.general.log
Then, create your file and change it's permissions by issuing the following command:
sudo touch /var/log/mysql.general.log sudo chown mysql.mysql /var/log/mysql.general.log
Lastly, you'll just need to restart MySQL for these changes to stick by issuing the following command:
service mysql restart
For more information regarding this, the link posted here may give you some more insight.
Hope that helps!