Friday, August 21, 2015

Quickly Toggle MySQL Logging

MySQL logging is a lifesaver when trying to understand applications at a low level. However, since I use it infrequently, I always have to consult the Google doc I have with the details on how to toggle the setting, and where to find the output.

For Windows, I've switched to a BAT file to speed up the process (which I call from SlickRun).

@echo off
set /p state="Set MySQL Logging state ON or OFF: "
c:\xampp\mysql\bin\mysql -u "root" -e "SET GLOBAL general_log = '%state%';
%SystemRoot%\explorer.exe "C:\xampp\mysql\data"