Search our database

How To Enable mySQL Query Log

It is best to enable mySQL query log so that you can backtrack your codes and steps for troubleshooting purposes. To do so, you will need to edit your mySQL configuration file.

 

Step 1 – Login into your web server via SSH.

 

Step 2 – Edit your mySQL configuration file by running the following commands.

vi /etc/my.cnf
#add in this line:
log=/tmp/mysql.log

 

Step 3 – Restart your mySQL service.

/etc/init.d/mysqld restart

 

You can now use commands such as tail command to trace your codes and steps from the log file.

tail -f /tmp/mysql.log

 

However, remember to turn off the option by removing the code from your configuration file and then restart the service. Else, the log file will accumulate over the time and take up space in your web server.

 

Affordable but Powerful Cloud Hosting Package

Check out IPServerOne’s Cloud Hosting Packages.
Contact us @ +603-6259-5625 or email @ sales@ipserverone.com

Tags: ,