Home  >  Article  >  Database  >  怎么清理mysql日志?

怎么清理mysql日志?

WBOY
WBOYOriginal
2016-06-07 16:17:541275browse

首先我们可以通过下面的命令来清理MYSQL日志: rm -f /usr/local/mysql/var/mysql-bin.* 然后重启自己的VPS即可,如果是LNMP用到: /root/lnmp restart 这样我们就删除了不需要的垃圾日志文件了,接下来如果我们需要禁止生成这些日志文件可以通过下面的命令

   首先我们可以通过下面的命令来清理MYSQL日志:

  rm -f /usr/local/mysql/var/mysql-bin.*

  然后重启自己的VPS即可,如果是LNMP用到:

  /root/lnmp restart

  这样我们就删除了不需要的垃圾日志文件了,,接下来如果我们需要禁止生成这些日志文件可以通过下面的命令。

  通过ssh,然后登陆root找到 /etc/my.cnf 文件

  log-bin=mysql-bin

  binlog_format=mixed

  将上面的两行前面的”#”字符去掉即可。这样就不会生成MYSQL日志文件了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn