1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| 1.进入MySQL,开启日志选项(默认情况应该是关闭的): mysql> set global general_log=on;
2. 查询本机MySQL执行日志保存的路径: mysql> show variables like 'general_log_file';
3. 重启MySQL服务器: systemctl restart mysqld
4. 查看MySQL执行日志:
tail -f /path/to/general_log_file
show binary logs; PURGE BINARY LOGS TO 'mysql-bin.033662';
|