Step1. 新增~/.my.cnf
touch ~/.my.cnf vim ~/.my.cnf
Step2. 加入底下的內容
general_log_file = /tmp/mysql.log general_log = 1
Step3. 重啟MySQL
/usr/local/mysql/support-files/mysql.server restart
參考網址:
How and When To Enable MySQL Logs
MySQL 設定 記錄執行過的 SQL 語法
touch ~/.my.cnf vim ~/.my.cnf
general_log_file = /tmp/mysql.log general_log = 1
/usr/local/mysql/support-files/mysql.server restart