1.查看是否开启
show variables where Variable_name="general_log";
2.开启
set global general_log=on;
3.查看日志路径
show variables where Variable_name="general_log_file";
4.关闭
set global general_log=off;
本文介绍了如何在MySQL中查看、开启、关闭以及获取日志路径的操作。通过`show variables where Variable_name=general_log`来检查日志状态,使用`set global general_log=on/off`进行开启或关闭,而`show variables where Variable_name=general_log_file`则用于查看日志文件位置。这些基础操作对于数据库监控和问题排查至关重要。
1.查看是否开启
show variables where Variable_name="general_log";
2.开启
set global general_log=on;
3.查看日志路径
show variables where Variable_name="general_log_file";
4.关闭
set global general_log=off;

被折叠的 条评论
为什么被折叠?