方法 查看日志是否打开show variables where Variable_name="general_log";若结果为OFF,则运行set global general_log=on;查看日志记录位置show variables where Variable_name="general_log_file"; 注意事项 会记录所有sql,建议只在调试时打开,调试完成后关闭set global general_log=off;