<?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>mysql-bin &#8211; 就爱分享</title>
	<atom:link href="https://www.9host.org/tag/mysql-bin/feed" rel="self" type="application/rss+xml" />
	<link>https://www.9host.org</link>
	<description>最爱分享各种资源的中文独立博客</description>
	<lastBuildDate>Fri, 10 May 2019 02:31:34 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>在LNMP下如何关闭MySQL日志并删除mysql-bin.0000*日志文件</title>
		<link>https://www.9host.org/1160.html</link>
					<comments>https://www.9host.org/1160.html#comments</comments>
		
		<dc:creator><![CDATA[河马大叔]]></dc:creator>
		<pubDate>Sat, 05 Oct 2013 01:22:43 +0000</pubDate>
				<category><![CDATA[新手教程]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql-bin]]></category>
		<category><![CDATA[MySql-bin.0000]]></category>
		<category><![CDATA[MySQL日志]]></category>
		<category><![CDATA[日志]]></category>
		<guid isPermaLink="false">http://www.9host.org/?p=1160</guid>

					<description><![CDATA[大叔前一阵子购入了一枚RamNode，为了图省事儿&#8230;]]></description>
										<content:encoded><![CDATA[<p>大叔前一阵子购入了一枚RamNode，为了图省事儿，安装了AMH面板，一个月的功夫，SSD硬盘空间居然用了一大半。大叔一拍脑子，才想起AMH的LNMP一键包安装的Mysql默认开启Mysql日志，如果网站对数据库读写较为频繁的话可能会产生大量日志，所以才会占用磁盘空间，估计再过一阵子，这枚VPS硬盘闲置空间消耗满会导致数据库无法开启。</p>
<p><img fetchpriority="high" decoding="async" src="https://www.9host.org/wp-content/uploads/2013/10/lnmp.png" alt="lnmp" width="600" height="400" class="aligncenter size-full wp-image-1255" srcset="https://www.9host.org/wp-content/uploads/2013/10/lnmp.png 600w, https://www.9host.org/wp-content/uploads/2013/10/lnmp-220x147.png 220w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>其实只需要关闭MySQL日志就可以解决这个问题啦，请执行以下操作：<br />
</br></p>
<h2>一、删除之前产生的日志</h2>
<h3>1）登录MYSQL</h3>
<p>SSH执行以下命令，输入密码后，进入MYSQL命令行模式。</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">/usr/local/mysql/bin/mysql -u root -p</pre>
<h3>2）重设帐号</h3>
<pre class="EnlighterJSRAW" data-enlighter-language="null">reset 9host;  #9host请修改为目标数据库名</pre>
<p></br></p>
<h2>二、修改文件配置</h2>
<p><strong>修改/etc/my.cnf</strong>，找到以下字符</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">
log-bin=mysql-bin
binlog_format=mixed</pre>
<p>注释这两行，如下：</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">
#log-bin=mysql-bin 
#binlog_format=mixed</pre>
<p>在这两个字段之前添加&ldquo;#&rdquo;号注释，并保存文件。<br />
</br></p>
<h2>三、重启Mysql使其生效</h2>
<p>SSH执行以下命令，重启Mysql使注释生效</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">service mysqld restart</pre>
<div class="su-note"  style="border-color:#e5e5bc;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#ffffd6;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">
<strong>河马大叔的温馨提示：</strong><br />
本文以AMH面板安装的LNMP环境为例。<br />
</div></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.9host.org/1160.html/feed</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
