Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1104003
  • 博文数量: 276
  • 博客积分: 10077
  • 博客等级: 上将
  • 技术积分: 2513
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-24 20:31
文章分类

全部博文(276)

文章存档

2020年(1)

2015年(5)

2012年(2)

2011年(6)

2010年(7)

2009年(224)

2008年(31)

我的朋友

分类: Mysql/postgreSQL

2009-02-23 23:06:05

是否启用了日志
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= d:/mysql/log/log-error.log
#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=
        
上面只开启了错误日志,要开其他的日志就把前面的“#”去掉。

阅读(13374) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~