灰儿 发表于 2007-10-3 21:51:40

如何开启mysql的日志?

mysql有以下几种日志: &nbsp; <BR>&nbsp; 错误日志: &nbsp; -log-err &nbsp; <BR>&nbsp; 查询日志: &nbsp; -log &nbsp; <BR>&nbsp; 慢查询日志: &nbsp; &nbsp; -log-slow-queries &nbsp; <BR>&nbsp; 更新日志: &nbsp; &nbsp; -log-update &nbsp; <BR>&nbsp; 二进制日志: &nbsp; -log-bin &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 在mysql的安装目录下,打开my.ini,在后面加上上面的参数,保存后重启mysql服务就行了。 &nbsp; <BR>&nbsp; 例如: &nbsp; <BR>&nbsp; #Enter &nbsp; a &nbsp; name &nbsp; for &nbsp; the &nbsp; binary &nbsp; log. &nbsp; Otherwise &nbsp; a &nbsp; default &nbsp; name &nbsp; will &nbsp; be &nbsp; used. &nbsp; <BR>&nbsp; #log-bin= &nbsp; <BR>&nbsp; #Enter &nbsp; a &nbsp; name &nbsp; for &nbsp; the &nbsp; query &nbsp; log &nbsp; file. &nbsp; Otherwise &nbsp; a &nbsp; default &nbsp; name &nbsp; will &nbsp; be &nbsp; used. &nbsp; <BR>&nbsp; #log= &nbsp; <BR>&nbsp; #Enter &nbsp; a &nbsp; name &nbsp; for &nbsp; the &nbsp; error &nbsp; log &nbsp; file. &nbsp; Otherwise &nbsp; a &nbsp; default &nbsp; name &nbsp; will &nbsp; be &nbsp; used. &nbsp; <BR>&nbsp; log-error= &nbsp; <BR>&nbsp; #Enter &nbsp; a &nbsp; name &nbsp; for &nbsp; the &nbsp; update &nbsp; log &nbsp; file. &nbsp; Otherwise &nbsp; a &nbsp; default &nbsp; name &nbsp; will &nbsp; be &nbsp; used. &nbsp; <BR>&nbsp; #log-update= &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 上面只开启了错误日志,要开其他的日志就把前面的“#”去掉。
页: [1]
查看完整版本: 如何开启mysql的日志?