文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>MYSQL启用日志,和查看日志

MYSQL启用日志,和查看日志

时间:2008-05-19  来源:sdccf

作者: Seyonb  出自: http://www.linuxdiyf.com
是否启用了日志
mysql>show variables like 'log_bin';

怎样知道当前的日志
mysql> show master status;

看二进制日志文件用mysqlbinlog
shell>mysqlbinlog mail-bin.000001
或者shell>mysqlbinlog mail-bin.000001 | tail

Windows 下用类似的命令。

mysql有以下几种日志:
错误日志: -log-err
查询日志: -log
慢查询日志: -log-slow-queries
更新日志: -log-update
二进制日志: -log-bin

在mysql的安装目录下,打开my.ini,在后面加上上面的参数,保存后重启mysql服务就行了。

例如:
#Enter a name for the error log file. Otherwise a default name will be used.
log-error=
#Enter a name for the query log file. Otherwise a default name will be used.
#log=
#Enter a name for the slow query log file. Otherwise a default name will be used.
#log-slow-queries=
#Enter a name for the update log file. Otherwise a default name will be used.
#log-update=
#Enter a name for the binary log. Otherwise a default name will be used.
#log-bin=

上面只开启了错误日志,要开其他的日志就把前面的“#”去掉。
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载