<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>猫言猫语 &#187; MySql-bin.0000</title>
	<atom:link href="http://imcat.in/tag/mysql-bin-0000/feed/" rel="self" type="application/rss+xml" />
	<link>http://imcat.in</link>
	<description>人的头脑太复杂,时间过得久,有时候连自己也被自己骗了,记下来才是最真实的……</description>
	<lastBuildDate>Sun, 06 May 2012 05:40:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>删除Mysql的MySql-bin.0000X日志文件</title>
		<link>http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/</link>
		<comments>http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/#comments</comments>
		<pubDate>Wed, 26 May 2010 13:32:09 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySql-bin.0000]]></category>

		<guid isPermaLink="false">http://imcat.in/?p=1290</guid>
		<description><![CDATA[装mysql,运行一段时间后，在mysql目录下出现一堆类似 mysql-bin.000***，从mysql-bin.000001开始一直排列下来，而且占用了大量硬盘空间，高达几十个G.  对于这些超大空间 占用量的文件我们应该怎么办呢? 我的数据库加起来大概100M吧..但/usr/local/mysql/var这个目录竟然有548M,MySql-bin.0000文件大概占 了400+M,真浪费空间啊 那么mysql数据库文件夹中的mysql-bin.00001是什么文件？ mysql-bin.000001、mysql- bin.000002等文件是数据库的操作日志，例如UPDATE一个表，或者DELETE一些数据，即使该语句没有匹配的数据，这个命令也会存储到日志 文件中，还包括每个语句执行的时间，也会记录进去的。 那么这些文件该怎么删除和禁止呢? 禁止方法: vi /etc/my.cnf把里面的 #log-bin=mysql-bin #binlog_format=mixed 注释掉,重启mysql服务即可. 删除方法: 输入命令: /usr/local/mysql/bin/mysql -u root -p 输入密码登陆mysql后,运行命令: reset master; (包括;号) 清空日志文件.再查看Mysql文件的大小,已经小了很多了. -bash-3.2# du -h –max-depth=1 /usr/local/mysql/var du: cannot access `250Cmax-depth=1': No such file or directory 142M    /usr/local/mysql/var 暧味日志简单的llmp(Litespeed+mysql+php)安装教程 (17)一步一步教你安装Nginx+PHP+Mysql (60)debian安装nginx+php(spawn-fcgi)+mysql (10)一定要修改的mysql默认预设值 (7)自动备份mysql数据库并发送到Email (20)]]></description>
			<content:encoded><![CDATA[<p>装mysql,运行一段时间后，在mysql目录下出现一堆类似  mysql-bin.000***，从mysql-bin.000001开始一直排列下来，而且占用了大量硬盘空间，高达几十个G.  对于这些超大空间  占用量的文件我们应该怎么办呢?<br />
<a title="mysql" rel="gallery-1290" href="http://imcat.in/wp-content/uploads/2010/05/mysql.jpg" target="_blank"><img title="删除Mysql的MySql bin.0000X日志文件" src="/wp-content/uploads/2010/05/mysql.jpg" alt="mysql 删除Mysql的MySql bin.0000X日志文件" width="231" height="289" /></a></p>
<p>我的数据库加起来大概100M吧..但/usr/local/mysql/var这个目录竟然有548M,MySql-bin.0000文件大概占 了400+M,真浪费空间啊<br />
<span id="more-1290"></span><br />
<strong>那么mysql数据库文件夹中的mysql-bin.00001是什么文件？</strong></p>
<blockquote><p>mysql-bin.000001、mysql-  bin.000002等文件是数据库的操作日志，例如UPDATE一个表，或者DELETE一些数据，即使该语句没有匹配的数据，这个命令也会存储到日志  文件中，还包括每个语句执行的时间，也会记录进去的。</p></blockquote>
<p><strong>那么这些文件该怎么删除和禁止呢?</strong><br />
禁止方法: vi /etc/my.cnf把里面的<br />
#log-bin=mysql-bin<br />
#binlog_format=mixed<br />
注释掉,重启mysql服务即可.</p>
<p>删除方法:</p>
<p>输入命令:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr/local/mysql/bin/mysql -u root -p</div></div>
<p><a title="mysql1" rel="gallery-1290" href="http://imcat.in/wp-content/uploads/2010/05/mysql1.jpg" target="_blank"><img title="删除Mysql的MySql bin.0000X日志文件" src="/wp-content/uploads/2010/05/mysql1.jpg" alt="mysql1 删除Mysql的MySql bin.0000X日志文件" width="394" height="47" /></a></p>
<p>输入密码登陆mysql后,运行命令:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">reset master;</div></div>
<p>(包括;号)</p>
<p>清空日志文件.再查看Mysql文件的大小,已经小了很多了.</p>
<p>-bash-3.2# du -h –max-depth=1 /usr/local/mysql/var<br />
du: cannot access `250Cmax-depth=1': No such file or directory<br />
142M    /usr/local/mysql/var</p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (60)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/we-must-modify-the-default-value-mysql-default/" title="一定要修改的mysql默认预设值">一定要修改的mysql默认预设值</a> (7)</li><li><a href="http://imcat.in/backup-mysql-databases-automatically-sent-to-email/" title="自动备份mysql数据库并发送到Email">自动备份mysql数据库并发送到Email</a> (20)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

