免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4864 | 回复: 10
打印 上一主题 下一主题

如何禁止mysql日志纪录? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-12 09:27 |只看该作者 |倒序浏览
We are dedicated to increasing your servers performance and upon investigation for improving our services, we have discovered that your MySQL logging is enabled and the result of this is that the log file has grown rather large (above 500 MBs), which could cause performance problems.


那么在哪禁用mysql loging呢?
机器环境
Operating System: Redhat Linux
Kernel Version: 2.4.26  
MySQL Version: 3.23.33

[ 本帖最后由 狗剩 于 2006-1-14 16:41 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-01-12 14:04 |只看该作者
不理解

论坛徽章:
0
3 [报告]
发表于 2006-01-14 16:40 |只看该作者
原帖由 macrodba 于 2006-1-12 14:04 发表
不理解

macrodba 兄,
   我的远程主机上mysql服务器日志现在是启用的,时间长很/usr/local/mysql/var/下生成几个G的日志纪录文件,兄弟想问的问题是“如何禁用掉mysql日志纪录这一项呢”,翻了mysql手册,不是很理解。

论坛徽章:
0
4 [报告]
发表于 2006-01-14 19:23 |只看该作者
原帖由 狗剩 于 2006-1-12 09:27 发表


那么在哪禁用mysql loging呢?
机器环境
Operating System: Redhat Linux
Kernel Version: 2.4.26  
MySQL Version: 3.23.33


请看 http://bbs.chinaunix.net/viewthread.php?tid=678644

论坛徽章:
0
5 [报告]
发表于 2006-01-14 23:06 |只看该作者
在/etc/my.cnf中去掉log(常规日志),log-update(更新日志)选项,
err-log(错误日志)

论坛徽章:
0
6 [报告]
发表于 2006-01-16 09:32 |只看该作者
thx 版主、ecs2003答复。
to ecs2003,我my.cnf里面没有log选项。只有如下内容。
  1. # This will be passed to all mysql clients
  2. [client]
  3. #password        = no-password
  4. user                = exoticea
  5. port                = 4419
  6. socket                = /vs7/exoticea/tmp/mysql.sock

  7. # Here is entries for some specific programs
  8. # The following values assume you have at least 32M ram

  9. # The MySQL server
  10. [mysqld]
  11. user                = exoticea
  12. port                = 4419
  13. socket                = /vs7/exoticea/tmp/mysql.sock
  14. tmpdir          = /vs7/exoticea/tmp
  15. basedir         = /vs7/exoticea/usr/local/mysql/


  16. skip-locking
  17. set-variable        = key_buffer=16M
  18. set-variable        = max_allowed_packet=1M
  19. set-variable        = thread_stack=128K
  20. # Start logging


  21. [mysqldump]
  22. quick
  23. set-variable        = max_allowed_packet=16M

  24. [mysql]
  25. no-auto-rehash

  26. [isamchk]
  27. set-variable        = key_buffer=16M
复制代码

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-03-12 06:20:00
7 [报告]
发表于 2006-01-16 15:13 |只看该作者
先登录mysql
shell>mysql -u root -p
mysql>show variables like 'log%';
看看你的log,log-update是不是都设置为On了

然后给你两种方法,你看看那种可以
1.shell>mysql --help
找到类似如下行
Default options are read from the following files in the given order:
/etc/my.cnf /var/lib/mysql/my.cnf ~/.my.cnf
在/etc/my.cnf /var/lib/mysql/my.cnf ~/.my.cnf3个文件中找找是否设置了log或者log-update
然后注释它
2.shell>mysql -u root -p
mysql>set sql_log_update=0

论坛徽章:
0
8 [报告]
发表于 2006-01-16 16:02 |只看该作者
学到了

论坛徽章:
0
9 [报告]
发表于 2006-01-16 17:21 |只看该作者
原帖由 qlks 于 2006-1-16 15:13 发表
先登录mysql
shell>mysql -u root -p
mysql>show variables like 'log%';
看看你的log,log-update是不是都设置为On了

然后给你两种方法,你看看那种可以
1.shell>mysql --help
找到类似如下行
D ...

首先感谢qlks 兄的答复,按照q兄的方式,查看变量如下:
Variable_name  Value  
log ON
log_update OFF
log_bin OFF
log_slave_updates OFF

搜便所有的my.cnf,.my.cnf,都没有发现有log选项

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-03-12 06:20:00
10 [报告]
发表于 2006-01-18 10:27 |只看该作者
没有log选项的话用第二种方法
shell>mysql -u mysql -p
mysql>set sql_log=0
试试看
测试的话可以把你的log文件移走
然后看看会不会生成新的log文件
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP