<?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</title>
	<atom:link href="http://www.wenzk.com/archives/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wenzk.com</link>
	<description>http://www.wenzk.com</description>
	<lastBuildDate>Thu, 09 Feb 2012 07:57:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Zimbra管理员总是能收到MySQL检查出错的邮件</title>
		<link>http://www.wenzk.com/archives/1447</link>
		<comments>http://www.wenzk.com/archives/1447#comments</comments>
		<pubDate>Tue, 18 Oct 2011 07:38:59 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-杂项]]></category>
		<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lock]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[ZCS]]></category>
		<category><![CDATA[Zimbra]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=1447</guid>
		<description><![CDATA[邮件大概内容为： 通过修复工具会发现，没有任何数据表需要修复，因此，可以这么解决这个错误： 从上面可以看出，错误提示没有了。 相关文章Moving ZCS to Another Server (0)Zimbra-proxy配置步骤 (0)新安装Cacti遇到的几个问题 (0)将 Zimbra Desktop 设为默认电子邮件程序 (0)zmmailbox导入邮件提示：Code:zclient.UPLOAD_SIZE_LIMIT_EXCEEDED (0)]]></description>
			<content:encoded><![CDATA[<p>邮件大概内容为：</p>
<pre class="brush: plain; title: ; notranslate">/opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /opt/zimbra/db/mysql.sock -A -C -s -u root --password=VGyGSVvw2mjCMWClWpcKwHjp1dj7W
mysql.general_log
Error    : You can't use locks with log tables.
mysql.slow_log
Error    : You can't use locks with log tables.</pre>
<p>通过修复工具会发现，没有任何数据表需要修复，因此，可以这么解决这个错误：</p>
<pre class="brush: plain; title: ; notranslate">[root@Zimbra-Mailbox-01 ~]# cd /opt/zimbra/db/data/mysql/
[root@Zimbra-Mailbox-01 mysql]# mv *log.frm /tmp/
[root@Zimbra-Mailbox-01 mysql]# /opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /opt/zimbra/db/mysql.sock -A -C -s -u root --password=VGyGSVvw2mjCMWClWpcKwHjp1dj7W</pre>
<p>从上面可以看出，错误提示没有了。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1424" title="Moving ZCS to Another Server">Moving ZCS to Another Server</a> (0)</li><li><a href="http://www.wenzk.com/archives/1388" title="Zimbra-proxy配置步骤">Zimbra-proxy配置步骤</a> (0)</li><li><a href="http://www.wenzk.com/archives/1516" title="新安装Cacti遇到的几个问题">新安装Cacti遇到的几个问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1509" title="将 Zimbra Desktop 设为默认电子邮件程序">将 Zimbra Desktop 设为默认电子邮件程序</a> (0)</li><li><a href="http://www.wenzk.com/archives/1501" title="zmmailbox导入邮件提示：Code:zclient.UPLOAD_SIZE_LIMIT_EXCEEDED">zmmailbox导入邮件提示：Code:zclient.UPLOAD_SIZE_LIMIT_EXCEEDED</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/1447/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix:BOTH mydestination and virtual_mailbox_domains</title>
		<link>http://www.wenzk.com/archives/1172</link>
		<comments>http://www.wenzk.com/archives/1172#comments</comments>
		<pubDate>Wed, 16 Feb 2011 17:10:55 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-杂项]]></category>
		<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[邮件]]></category>
		<category><![CDATA[错误]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=1172</guid>
		<description><![CDATA[先来看看一段Postfix的配置： 从上面的配置可以看出来，而mydestination = $mynetworks $myhostname，其他所有的邮箱都是在数据库里面的“虚拟”邮箱， 所以都是以virtual_xxxx里面定义的。 如果此时，你打算把所有@mail.wenzk.com的邮箱用户也放到数据库里面，通过mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf可以查询得到。 但是你会发现，往@mail.wenzk.com发送邮件的时候总是会有错误： postfix/trivial-rewrite[3905]: warning: do not list domain mail.wenzk.com in BOTH mydestination and virtual_mailbox_domains 这个时候就导致系统不知道把@mail.wenzk.com投递到什么地方，直接退回。 解决办法：把mydestination包含的mail.wenzk.com去掉即可。 好久没配置postfix了，这样的错误也能犯。 相关文章如何让postfix接收所有邮件并投递到一个邮箱里 (0)zmmailbox导入邮件提示：Code:zclient.UPLOAD_SIZE_LIMIT_EXCEEDED (0)Zimbra管理员总是能收到MySQL检查出错的邮件 (0)解决Zimbra收取POP3邮件问题 (4)CentOS 6.0下安装Zimbra简单步骤及故障排查 (0)]]></description>
			<content:encoded><![CDATA[<p>先来看看一段Postfix的配置：</p>
<pre><span id="more-1172"></span>
<pre class="brush: plain; title: ; notranslate"># hostname
mynetworks = 127.0.0.1
myhostname = mail.wenzk.com
mydomain = wenzk.com
myorigin = $mydomain
mydestination = $mynetworks $myhostname
# banner
mail_name = Postfix - by $mydomain
smtpd_banner = $myhostname ESMTP $mail_name
# response immediately
smtpd_error_sleep_time = 3s
unknown_local_recipient_reject_code = 550
# extmail config here
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = maildrop:
# smtpd related config
smtpd_recipient_restrictions =
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_non_fqdn_hostname,
 reject_non_fqdn_sender,
 reject_non_fqdn_recipient,
 reject_unauth_destination,
 reject_unauth_pipelining,
 reject_invalid_hostname,
# SMTP AUTH config here
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
maildrop_destination_recipient_limit = 1
inet_protocols = all
</pre>
<p> 从上面的配置可以看出来，而mydestination = $mynetworks $myhostname，其他所有的邮箱都是在数据库里面的“虚拟”邮箱，<br />
所以都是以virtual_xxxx里面定义的。 如果此时，你打算把所有@mail.wenzk.com的邮箱用户也放到数据库里面，通过mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf可以查询得到。<br />
但是你会发现，往@mail.wenzk.com发送邮件的时候总是会有错误：<br />
postfix/trivial-rewrite[3905]: warning: do not list domain mail.wenzk.com in BOTH mydestination and virtual_mailbox_domains 这个时候就导致系统不知道把@mail.wenzk.com投递到什么地方，直接退回。  解决办法：把mydestination包含的mail.wenzk.com去掉即可。 好久没配置postfix了，这样的错误也能犯。</pre>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1156" title="如何让postfix接收所有邮件并投递到一个邮箱里">如何让postfix接收所有邮件并投递到一个邮箱里</a> (0)</li><li><a href="http://www.wenzk.com/archives/1501" title="zmmailbox导入邮件提示：Code:zclient.UPLOAD_SIZE_LIMIT_EXCEEDED">zmmailbox导入邮件提示：Code:zclient.UPLOAD_SIZE_LIMIT_EXCEEDED</a> (0)</li><li><a href="http://www.wenzk.com/archives/1447" title="Zimbra管理员总是能收到MySQL检查出错的邮件">Zimbra管理员总是能收到MySQL检查出错的邮件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1380" title="解决Zimbra收取POP3邮件问题">解决Zimbra收取POP3邮件问题</a> (4)</li><li><a href="http://www.wenzk.com/archives/1339" title="CentOS 6.0下安装Zimbra简单步骤及故障排查">CentOS 6.0下安装Zimbra简单步骤及故障排查</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/1172/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress数据库使用非默认端口[非3306端口]</title>
		<link>http://www.wenzk.com/archives/1055</link>
		<comments>http://www.wenzk.com/archives/1055#comments</comments>
		<pubDate>Fri, 29 Oct 2010 16:15:58 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-杂项]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[修改]]></category>
		<category><![CDATA[端口]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=1055</guid>
		<description><![CDATA[在Wrodpress的配置文件中只有定义数据库服务器地址，并没有填写端口的地方 如果你的机器运行了多个MySQL数据库（新版本WP只能运行在4.x以上的MySQL上）。 此时，只能通过本地的socks文件来连接数据库了，格式如下： 不知道这个地址是否有需要改进，如果数据库不是运行在本机，难道只能靠iptables的NAT来搞定了？ 相关文章Zimbra管理员总是能收到MySQL检查出错的邮件 (0)20 Free WordPress Business &#038; Corporate Themes for 2011 (0)黑莓8310修改IMEI简单步骤 (0)Postfix:BOTH mydestination and virtual_mailbox_domains (0)Wordpress中与分类、标签有关的几个数据表 (0)]]></description>
			<content:encoded><![CDATA[<p>在Wrodpress的配置文件中只有定义数据库服务器地址，并没有填写端口的地方</p>
<pre class="brush: plain; title: ; notranslate">define('DB_HOST', 'localhost');</pre>
<p>如果你的机器运行了多个MySQL数据库（新版本WP只能运行在4.x以上的MySQL上）。</p>
<p>此时，只能通过本地的socks文件来连接数据库了，格式如下：</p>
<pre class="brush: plain; title: ; notranslate">define('DB_HOST', 'localhost:/tmp/mysql.sock');</pre>
<p>不知道这个地址是否有需要改进，如果数据库不是运行在本机，难道只能靠iptables的NAT来搞定了？</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1447" title="Zimbra管理员总是能收到MySQL检查出错的邮件">Zimbra管理员总是能收到MySQL检查出错的邮件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1290" title="20 Free WordPress Business &#038; Corporate Themes for 2011">20 Free WordPress Business &#038; Corporate Themes for 2011</a> (0)</li><li><a href="http://www.wenzk.com/archives/1176" title="黑莓8310修改IMEI简单步骤">黑莓8310修改IMEI简单步骤</a> (0)</li><li><a href="http://www.wenzk.com/archives/1172" title="Postfix:BOTH mydestination and virtual_mailbox_domains">Postfix:BOTH mydestination and virtual_mailbox_domains</a> (0)</li><li><a href="http://www.wenzk.com/archives/1078" title="Wordpress中与分类、标签有关的几个数据表">Wordpress中与分类、标签有关的几个数据表</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/1055/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL镜像站点</title>
		<link>http://www.wenzk.com/archives/1053</link>
		<comments>http://www.wenzk.com/archives/1053#comments</comments>
		<pubDate>Fri, 29 Oct 2010 14:48:06 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[下载]]></category>
		<category><![CDATA[镜像]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=1053</guid>
		<description><![CDATA[http://download.softagency.net/ 从官方下载MySQL程序还要填写一堆报表，麻烦，从这个站点就可以直接下载。 相关文章Mirroring MySQL.com (0)如何为逻辑卷创建镜像 (0)Zimbra管理员总是能收到MySQL检查出错的邮件 (0)通过CURL获得平均下载输率 (0)Postfix:BOTH mydestination and virtual_mailbox_domains (0)]]></description>
			<content:encoded><![CDATA[<p><a href="http://download.softagency.net/" target="_blank">http://download.softagency.net/</a></p>
<p>从官方下载MySQL程序还要填写一堆报表，麻烦，从这个站点就可以直接下载。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/191" title="Mirroring MySQL.com">Mirroring MySQL.com</a> (0)</li><li><a href="http://www.wenzk.com/archives/1464" title="如何为逻辑卷创建镜像">如何为逻辑卷创建镜像</a> (0)</li><li><a href="http://www.wenzk.com/archives/1447" title="Zimbra管理员总是能收到MySQL检查出错的邮件">Zimbra管理员总是能收到MySQL检查出错的邮件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1360" title="通过CURL获得平均下载输率">通过CURL获得平均下载输率</a> (0)</li><li><a href="http://www.wenzk.com/archives/1172" title="Postfix:BOTH mydestination and virtual_mailbox_domains">Postfix:BOTH mydestination and virtual_mailbox_domains</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/1053/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>企业级备份软件-BackupPC</title>
		<link>http://www.wenzk.com/archives/1021</link>
		<comments>http://www.wenzk.com/archives/1021#comments</comments>
		<pubDate>Fri, 08 Oct 2010 15:30:49 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[BackupPC]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[备份]]></category>
		<category><![CDATA[数据]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=1021</guid>
		<description><![CDATA[以前用过BackupPC，后来由于存储的问题，放弃很长一段时间，最近又回归BackupPC了，发现CGI的功能增加了不少，以前配置文件只能修改配置文件，现在通过web就可以搞定了。 看看大家是怎么来描述BackupPC的吧 BackupPC是一个D2D备份解决方案，有很多值得一试的独特之处。与微软的Data Protection Manager一样，它也允许备份多台机器到一个硬盘驱动中。不过，它们也有很多不同之处。 用过Data Protection Manager的朋友一定知道，它会在存储池中为每台机器创建一个专用的卷来保护备份数据。而且，在被备份机器上需要安装代理组件以确保它按照一定周期被备份。 而BackupPC不需要在被备份机器上安装任何代理或其它软件组件。更重要的是，它能比Data Protection Manager更有效地利用存储池的空间。例如，假设你使用Data Protection Manager备份5个不同Windows服务器，它就会创建5个私有卷分别备份这5台服务器。这样，每个卷就都会包含一份同样的Windows系统文 件。使用BackupPC则可以解决这样的问题，大大提高存储池的利用率。 单例（single-instance）存储 BackupPC采用的是单例存储，而且是在不同目标机器（被备份/保护的机器）间实现单例存储。例如，如果你有5台机器使用同一版本的系统文件，那么这 些系统文件在存储池中将只保留一份，而不是Data Protection Manager中的5份。这有可能节省很大的硬盘空间。 如果你还想节省更大的空间，可以使用它的压缩功能。据该产品的说明书介绍，其压缩功能可以缩减文件大小近40%。 总所周知备份产品的压缩功能都会使服务器机器缓慢，因为数据压缩是一个很耗费CPU资源的工作。尽管BackupPC在数据压缩过程中也耗费CPU资源，但由于它采用的是单例存储，只有从未备份过的数据才会被备份，所以服务器承担的数据压缩负载不会太大。 由于BackupPC是一个Linux应用，所以你可能会期望它能备份运行Linux的其它机器。事实上，它还可以备份运行Windows和 Macintosh OS X的计算机。在使用BackupPC备份Windows系统的机器时，它利用SMB（Server Message Blocks）访问正在备份的数据。备份Linux或OS X的机器时，BackupPC可以使用RSYNC、SSH上的TAR、RSH或NFS访问备份数据。不过，这没有硬性要求。例如，如果你想备份 Windows机器，而不想使用SMB， 你也可以安装CYGWIN，然后用RSYNC备份该Windows机器。或者，你也可以在Linux上安装SAMBA，它允许使用SMB进行备份。 可以看到，BackupPC是一款非常灵活的备份软件，非常适用于多种环境下的企业级备份。 需要注意的是，BackupPC备份的是文件，对于MySQL数据库，可能要借助：AutoMySQLBackup将数据库dump成一个个的文件，这样BackupPC就可以被封了。 一开始不太熟悉BackupPC的使用技巧，在备份的时候直接使用IP地址，如果机器的IP地址发生变化，如果将原有的备份迁移到新的IP地址上呢？其实很简单，只需2个步骤： 1、修改BackupPC的hosts文件，将IP地址改成新的，如果这个机器有一些特殊的配置，需要把配置文件目录下pc/IP.pl文件名改成新的IP地址。 2、将备份数据目录下的pc/IP目录重命名为新的IP地址即可。 如果你觉得麻烦，在增加主机的时候可以使用域名，直接修改/etc/hosts文件来确定该域名的IP地址，以后修改hosts文件就可以很方便的更换地址了。 相关文章Linux下如何使用tar进行整系统备份["Ghost"] (0)Linux下如何整系统备份/恢复 (0)Zimbra管理员总是能收到MySQL检查出错的邮件 (0)如何迁移OpenVZ中的VPS主机 (0)Postfix:BOTH mydestination and virtual_mailbox_domains (0)]]></description>
			<content:encoded><![CDATA[<p>以前用过BackupPC，后来由于存储的问题，放弃很长一段时间，最近又回归BackupPC了，发现CGI的功能增加了不少，以前配置文件只能修改配置文件，现在通过web就可以搞定了。</p>
<p><span id="more-1021"></span>看看大家是怎么来描述BackupPC的吧<br />
BackupPC是一个D2D备份解决方案，有很多值得一试的独特之处。与微软的Data Protection Manager一样，它也允许备份多台机器到一个硬盘驱动中。不过，它们也有很多不同之处。<br />
用过Data Protection Manager的朋友一定知道，它会在存储池中为每台机器创建一个专用的卷来保护备份数据。而且，在被备份机器上需要安装代理组件以确保它按照一定周期被备份。<br />
而BackupPC不需要在被备份机器上安装任何代理或其它软件组件。更重要的是，它能比Data Protection Manager更有效地利用存储池的空间。例如，假设你使用Data Protection Manager备份5个不同Windows服务器，它就会创建5个私有卷分别备份这5台服务器。这样，每个卷就都会包含一份同样的Windows系统文 件。使用BackupPC则可以解决这样的问题，大大提高存储池的利用率。<br />
单例（single-instance）存储<br />
BackupPC采用的是单例存储，而且是在不同目标机器（被备份/保护的机器）间实现单例存储。例如，如果你有5台机器使用同一版本的系统文件，那么这 些系统文件在存储池中将只保留一份，而不是Data Protection Manager中的5份。这有可能节省很大的硬盘空间。<br />
如果你还想节省更大的空间，可以使用它的压缩功能。据该产品的说明书介绍，其压缩功能可以缩减文件大小近40%。<br />
总所周知备份产品的压缩功能都会使服务器机器缓慢，因为数据压缩是一个很耗费CPU资源的工作。尽管BackupPC在数据压缩过程中也耗费CPU资源，但由于它采用的是单例存储，只有从未备份过的数据才会被备份，所以服务器承担的数据压缩负载不会太大。<br />
由于BackupPC是一个Linux应用，所以你可能会期望它能备份运行Linux的其它机器。事实上，它还可以备份运行Windows和 Macintosh OS X的计算机。在使用BackupPC备份Windows系统的机器时，它利用SMB（Server Message Blocks）访问正在备份的数据。备份Linux或OS X的机器时，BackupPC可以使用RSYNC、SSH上的TAR、RSH或NFS访问备份数据。不过，这没有硬性要求。例如，如果你想备份 Windows机器，而不想使用SMB， 你也可以安装CYGWIN，然后用RSYNC备份该Windows机器。或者，你也可以在Linux上安装SAMBA，它允许使用SMB进行备份。<br />
可以看到，BackupPC是一款非常灵活的备份软件，非常适用于多种环境下的企业级备份。</p>
<p>需要注意的是，BackupPC备份的是文件，对于MySQL数据库，可能要借助：<a href="http://sourceforge.net/projects/automysqlbackup" target="_blank">AutoMySQLBackup</a>将数据库dump成一个个的文件，这样BackupPC就可以被封了。</p>
<p>一开始不太熟悉BackupPC的使用技巧，在备份的时候直接使用IP地址，如果机器的IP地址发生变化，如果将原有的备份迁移到新的IP地址上呢？其实很简单，只需2个步骤：</p>
<p>1、修改BackupPC的hosts文件，将IP地址改成新的，如果这个机器有一些特殊的配置，需要把配置文件目录下pc/IP.pl文件名改成新的IP地址。</p>
<p>2、将备份数据目录下的pc/IP目录重命名为新的IP地址即可。</p>
<p>如果你觉得麻烦，在增加主机的时候可以使用域名，直接修改/etc/hosts文件来确定该域名的IP地址，以后修改hosts文件就可以很方便的更换地址了。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1469" title="Linux下如何使用tar进行整系统备份["Ghost"]">Linux下如何使用tar进行整系统备份["Ghost"]</a> (0)</li><li><a href="http://www.wenzk.com/archives/1467" title="Linux下如何整系统备份/恢复">Linux下如何整系统备份/恢复</a> (0)</li><li><a href="http://www.wenzk.com/archives/1447" title="Zimbra管理员总是能收到MySQL检查出错的邮件">Zimbra管理员总是能收到MySQL检查出错的邮件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1436" title="如何迁移OpenVZ中的VPS主机">如何迁移OpenVZ中的VPS主机</a> (0)</li><li><a href="http://www.wenzk.com/archives/1172" title="Postfix:BOTH mydestination and virtual_mailbox_domains">Postfix:BOTH mydestination and virtual_mailbox_domains</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/1021/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>discuz常用sql语句【转载】</title>
		<link>http://www.wenzk.com/archives/841</link>
		<comments>http://www.wenzk.com/archives/841#comments</comments>
		<pubDate>Tue, 27 Apr 2010 15:08:42 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[Discuz]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[论坛]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=841</guid>
		<description><![CDATA[搜集了一些常用的sql语句。 此操作有风险！升级前请备份好数据库！！ UPDATE `cdb_forums` SET `allowtag` = ‘1′; allowtag参数有：0＝关闭 1＝使用 2＝使用且自动生成。均指所有版块 UPDATE `cdb_forums` SET `allowpostspecial` = ‘31′ 所有板块的特殊主题开启 UPDATE `cdb_members` SET `groupid` = ‘10′ WHERE groupid=’8′; 批量删除等待验证用户 UPDATE `cdb_forums` SET `allowmediacode` = ‘1′ 所有板块开启media代码 update cdb_settings set value = 120 WHERE variable = ‘maxavatarpixel’ 调整所有用户最大头像尺寸（像素）为120 UPDATE  cdb_threads SET  closed  = 1  WHERE  fid =20 ; [...]]]></description>
			<content:encoded><![CDATA[<p>搜集了一些常用的sql语句。</p>
<p>此操作有风险！升级前请备份好数据库！！</p>
<p><span id="more-841"></span>UPDATE `cdb_forums` SET `allowtag` = ‘1′;<br />
allowtag参数有：0＝关闭 1＝使用 2＝使用且自动生成。均指所有版块</p>
<p>UPDATE `cdb_forums` SET `allowpostspecial` = ‘31′<br />
所有板块的特殊主题开启</p>
<p>UPDATE `cdb_members` SET `groupid` = ‘10′ WHERE groupid=’8′;<br />
批量删除等待验证用户</p>
<p>UPDATE `cdb_forums` SET `allowmediacode` = ‘1′<br />
所有板块开启media代码</p>
<p>update cdb_settings set value = 120 WHERE variable = ‘maxavatarpixel’<br />
调整所有用户最大头像尺寸（像素）为120</p>
<p>UPDATE  cdb_threads SET  closed  = 1  WHERE  fid =20 ;<br />
一次性关闭板块fid20帖子</p>
<p>update cdb_members set groupid = * where posts = 0;<br />
把发帖数为0的用户都转到某个用户组</p>
<p>UPDATE `cdb_usergroups` SET `allowinvite` = ‘1′, `inviteprice` = ‘价格’;<br />
开启全部用户组的邀请注册权限 并设置价格</p>
<p>replace INTO cdb_settings VALUES (’watermarktype’,&#8217;0′);<br />
去除水印图片类型</p>
<p>update cdb_members set lastpost=’1186675200′;<br />
调整用户最后登录时间为 2007年8月10日</p>
<p>UPDATE `cdb_forums` SET `status` = &#8217;0&#8242;  WHERE `cdb_forums`.`fid` =6 LIMIT 1 ;<br />
调整`fid` =6板块隐藏的sql！</p>
<p>update cdb_threads set fid=B板块ID,typeid=c分类的ID where fid=A板块ID;<br />
update cdb_posts set fid=B板块ID where fid=A板块ID;<br />
将A板块的所有帖子转到B板块的C分类里<br />
执行前备份一下数据库</p>
<p>UPDATE `cdb_settings` SET `value` = ” WHERE CONVERT( `variable` USING utf8 ) =’adminipaccess’ LIMIT 1 ;<br />
去除后台管理员ip登录限制</p>
<p>delete from cdb_styles where styleid=5 limit 1;<br />
删除风格5</p>
<p>UPDATE `cdb_members` SET `pmsound` = ‘1′<br />
论坛所有用户短消息提示音修改为提示音1</p>
<p>delete from cdb_usergroups where groupid = 0<br />
删除groupid = 0的用户组</p>
<p>UPDATE `cdb_forums` SET `alloweditpost` = ‘1′<br />
所有板块开启允许编辑帖子</p>
<p>delete from cdb_settings where variable=’insenz’<br />
论坛后台 解除insenz绑定语句<br />
论坛后台执行后 就可以 重新注册和绑定了</p>
<p>update cdb_forumfields set viewperm =’t允许浏览的用户组的IDt’ where fid in(论坛板块ID)<br />
如:<br />
update cdb_forumfields set viewperm =’t1t2t’ where fid in(1,2)<br />
关闭游客浏览所有版块的语句</p>
<p>UPDATE `cdb_forumfields` SET `rules` = ‘板块规则’<br />
所有板块的板块规则设置~！</p>
<p>UPDATE `cdb_forums` SET `jammer` = ‘1′<br />
开启所有板块的干扰码</p>
<p>UPDATE cdb_usergroups SET allowinvite=1, allowmailinvite=1, maxinvitenum=10, maxinviteday=15, inviteprice=10;<br />
开启所有会员组邀请注册的权限</p>
<p>//allowinvite 允许使用邀请注册:<br />
//allowmailinvite 允许发送邀请注册:<br />
//maxinvitenum 24小时内购买邀请码最大数量:<br />
//maxinviteday 邀请码有效期:<br />
//inviteprice 邀请码购买价格:</p>
<p>UPDATE `cdb_settings` SET `value` = ‘昨日发帖数 最高日发帖数’ WHERE `variable` =’historyposts’ LIMIT 1 ;<br />
修改最高日发帖数</p>
<p>‘昨日发帖数 最高日发帖数’ 中间的空格是tab键~！<br />
昨日发帖数 和 最高日发帖数 修改为你需要的数字即可， 升级完sql后,更新缓存</p>
<p>UPDATE `cdb_settings` SET `value` = ‘0′ WHERE CONVERT( `variable` USING utf8 ) = ‘gzipcompress’ LIMIT 1 ;<br />
关闭论坛的gzip设置！<br />
update cdb_members set adminid=’-1′, groupid=’4′ where groupid=’?&#8217;;<br />
批量对用户组禁言</p>
<p>delete from cdb_threads where authorid=0;<br />
delete from cdb_posts where authorid=0;<br />
批量删除游客组的发帖和主题</p>
<p>update cdb_members set credits=0,extcredits1=0,extcredits2=0,extcredits3=0,extcredits4=0,extcredits5=0,extcredits6=0,extcredits7=0,extcredits8=0 where uid &gt; 2000 and uid &lt; 3000;<br />
uid 2000~3000的会员全部积分清零</p>
<p>update cdb_posts set invisible = 0 where tid &gt; 最小的tid and tid &lt; 最大的 tid<br />
指定范围内的审核帖子通过审核</p>
<p>update cdb_threads set displayorder=0 where tid &gt; 最小的 tid and tid &lt; 最大的 tid<br />
指定范围内的审核主题通过审核</p>
<p>delete from cdb_threads where displayorder=-2;<br />
delete from cdb_posts where invisible=-2;<br />
批量删除未审核通过的帖子和主题</p>
<p>UPDATE cdb_threads SET closed = 1 WHERE special=1<br />
批量关闭投票</p>
<p>UPDATE `cdb_members` SET `secques` = ”<br />
清空用户安全问答！</p>
<p>update cdb_members set credits = 0, extcredits1 = 0, extcredits2 = 0, extcredits3 = 0, extcredits4 = 0, extcredits5 = 0, extcredits6 = 0, extcredits7 = 0, extcredits8 = 0, where groupid = 用户组id;<br />
清空某个用户组的全部积分</p>
<p>update cdb_usergroups set allowtransfer=0<br />
关闭所有用户组的积分转账</p>
<p>update cdb_threads set readperm=100 where dateline&lt;1133300000<br />
修改05年11月29日21点33份20秒 前的主题阅读权限100<br />
其中1133300000 是unix时间戳 （以秒为单位） 代表 05年11月29日21点33份20秒<br />
readperm=100 代表阅读权限</p>
<p>update cdb_threads set readperm=100 where dateline&lt;1104537600 and digest=0<br />
把2005年1月1日以前的阅读权限设高.</p>
<p>update cdb_ratelog set uid = ‘新uid’, username = ‘新username’ where uid = ‘旧的 uid’;<br />
批量替换帖子里面的评分者的用户名</p>
<p>update cdb_attachments set readperm=1<br />
所有的附件默认阅读权限为1</p>
<p>SELECT count(`extcredits1`) FROM `cdb_members` where `posts`=0<br />
统计发帖量大于0的所有用户积分1的总量</p>
<p>UPDATE `cdb_members` SET `showemail` =’1′ WHERE `uid` in(1,2,3,4,5,6);<br />
批量修改uid1~6会员的 showemail 为 1</p>
<p>update cdb_members set extcredits1=extcredits1+extcredits2;<br />
update cdb_members set extcredits1=’0′;<br />
将积分1加到积分2上 并清零积分1</p>
<p>update cdb_members set adminid=-1,groupid=特殊用户组ID where lastactivity&lt; unix_timestamp()-300*24*3600<br />
把300天未登录的ID移到某一特殊用户组</p>
<p>delete from cdb_forums where fid=1 limit1;<br />
删除fid=1的板块</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1447" title="Zimbra管理员总是能收到MySQL检查出错的邮件">Zimbra管理员总是能收到MySQL检查出错的邮件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1320" title="用iptables做NAT地址池问题">用iptables做NAT地址池问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1242" title="Discuz X2又有漏洞了">Discuz X2又有漏洞了</a> (0)</li><li><a href="http://www.wenzk.com/archives/1239" title="Nginx+Discuz无法登陆后台解决办法">Nginx+Discuz无法登陆后台解决办法</a> (0)</li><li><a href="http://www.wenzk.com/archives/1172" title="Postfix:BOTH mydestination and virtual_mailbox_domains">Postfix:BOTH mydestination and virtual_mailbox_domains</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/841/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD Ports变化带来的一点小麻烦</title>
		<link>http://www.wenzk.com/archives/553</link>
		<comments>http://www.wenzk.com/archives/553#comments</comments>
		<pubDate>Thu, 21 Jan 2010 15:07:30 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[升级]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=553</guid>
		<description><![CDATA[平常使用Linux比较多，为熟悉和了解FreeBSD，在虚拟机下安装了一个FreeBSD，为了了解FreeBSD的升级功能，特意安装7.2版本，通过网络升级，升级到8.0版本。 因为是测试的，所以port里面的软件都是安装最新的，自然MySQL就是用6.0了。但是最近通过csup更新ports tree之后发现部分软件无法升级，提示找不到mysql60-client。 经过核对，在ports里面的databases里面果真mysql60-client和mysql60-server果真不存在了，google之后发现： 没办法，只能换回5.5啦，为了删除MySQL6.0，被迫一起删除相依赖的一些软件，如php5-mysqli扩展。 经过漫长的编译后，终于轮到重新安装php扩展了，但是却发现这样的提示： 没办法，只能继续Google，原来解决办法是这样的： From: http://www.freebsdchina.org/forum/viewtopic.php?p=245925&#38;sid=0b6d25bb6d25f99101276165fc707e4d 看来用哪个系统都会遇到一些苦恼的事情啊 相关文章FreeBSD 6.2在线升级至8.0-RELEASE (0)FreeBSD portupgrade升级你的FreeBSD软件 (0)FreeBSD下软件的portupgrade升级方法 (0)Zimbra管理员总是能收到MySQL检查出错的邮件 (0)Discuz X2又有漏洞了 (0)]]></description>
			<content:encoded><![CDATA[<p>平常使用Linux比较多，为熟悉和了解FreeBSD，在虚拟机下安装了一个FreeBSD，为了了解FreeBSD的升级功能，特意安装7.2版本，通过网络升级，升级到8.0版本。</p>
<p><span id="more-553"></span>因为是测试的，所以port里面的软件都是安装最新的，自然MySQL就是用6.0了。但是最近通过csup更新ports tree之后发现部分软件无法升级，提示找不到mysql60-client。</p>
<p>经过核对，在ports里面的databases里面果真mysql60-client和mysql60-server果真不存在了，google之后发现：</p>
<pre class="brush: plain; title: ; notranslate">DEPRECATED: The MySQL 6.0  development branch is deprecated and will be removed soon.  Please  consider using MySQL 5.5 instead.

http://www.freshports.org/databases/mysql60-client/</pre>
<p>没办法，只能换回5.5啦，为了删除MySQL6.0，被迫一起删除相依赖的一些软件，如php5-mysqli扩展。</p>
<p>经过漫长的编译后，终于轮到重新安装php扩展了，但是却发现这样的提示：</p>
<pre class="brush: plain; title: ; notranslate">/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:  In function 'zm_startup_mysqli':
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:637:  error: 'MYSQL_RPL_MASTER' undeclared (first use in this function)
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:637:  error: (Each undeclared identifier is reported only once
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:637:  error: for each function it appears in.)
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:638:  error: 'MYSQL_RPL_SLAVE' undeclared (first use in this function)
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:639:  error: 'MYSQL_RPL_ADMIN' undeclared (first use in this function)</pre>
<p>没办法，只能继续Google，原来解决办法是这样的：</p>
<pre class="brush: bash; title: ; notranslate">cd /usr/local/include/mysql
 toor@com[/usr/local/include/mysql]  ee mysql.h</pre>
<pre class="brush: cpp; title: ; notranslate"> ... ...
enum mysql_protocol_type
 {
 MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
 MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
 };
 /*
 There are three types of queries - the ones  that have to go to
 the master, the ones that go to a slave, and the adminstrative
 type which must happen on the pivot connectioin
 */
 enum mysql_rpl_type
 {
 MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
 };

 typedef struct character_set
 {
 unsigned int      number;     /* character set number              */
 unsigned int      state;      /* character set state               */
 const char        *csname;    /* collation name                    */
 const char        *name;      /* character set name                */
 ... ...</pre>
<p>From: http://www.freebsdchina.org/forum/viewtopic.php?p=245925&amp;sid=0b6d25bb6d25f99101276165fc707e4d</p>
<p>看来用哪个系统都会遇到一些苦恼的事情啊</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/792" title="FreeBSD 6.2在线升级至8.0-RELEASE">FreeBSD 6.2在线升级至8.0-RELEASE</a> (0)</li><li><a href="http://www.wenzk.com/archives/433" title="FreeBSD portupgrade升级你的FreeBSD软件">FreeBSD portupgrade升级你的FreeBSD软件</a> (0)</li><li><a href="http://www.wenzk.com/archives/431" title="FreeBSD下软件的portupgrade升级方法">FreeBSD下软件的portupgrade升级方法</a> (0)</li><li><a href="http://www.wenzk.com/archives/1447" title="Zimbra管理员总是能收到MySQL检查出错的邮件">Zimbra管理员总是能收到MySQL检查出错的邮件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1242" title="Discuz X2又有漏洞了">Discuz X2又有漏洞了</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/553/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mirroring MySQL.com</title>
		<link>http://www.wenzk.com/archives/191</link>
		<comments>http://www.wenzk.com/archives/191#comments</comments>
		<pubDate>Thu, 01 Oct 2009 06:43:12 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[镜像]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=191</guid>
		<description><![CDATA[Running a public MySQL mirror currently requires about 170GB of storage. The bandwith that will be used is dependent on the number of mirrors in your area, and the number of users in your area who choose to use your mirror. We have a few primary mirrors that are used to provide data for the [...]]]></description>
			<content:encoded><![CDATA[<p>Running a public MySQL mirror currently requires about 170GB of storage. The bandwith that will be used is dependent on the number of mirrors in your area, and the number of users in your area who choose to use your mirror.</p>
<p>We have a few primary mirrors that are used to provide data for the other mirrors, using the <a href="http://rsync.samba.org/">rsync</a> program. The mirrored site consists only of static HTML, images, and other files, so there are no other special server requirements.</p>
<p><span id="more-191"></span>To keep your mirror up to date, you will want to set up a cron task like the following:</p>
<pre>1 */6 * * * rsync -a --delete --delete-after \
             rsync://example.com/mysql/ /path/to/local/mirror/</pre>
<p>You should synchronize your mirror at least daily, and no more often than once every hour. If you customize the minute at which your mirror updates, that will help spread the load on our primary mirrors.</p>
<h2>Current Primary Mirrors Which You Can rsync Against</h2>
<div>
<table border="0">
<tbody>
<tr>
<th colspan="3">North America</th>
</tr>
<tr>
<td><a href="http://www.he.net/"><img src="http://www.wenzk.com/wp-content/uploads/2010/03/5d0b_hurricane_electric.gif" border="0" alt="Hurricane Electric" width="183" height="42" align="middle" /></a></td>
<td>rsync://mysql.he.net/mysql/</td>
<td>(Fremont, CA)</td>
</tr>
<tr>
<td><a href="http://www.pair.com/"><img src="http://www.wenzk.com/wp-content/uploads/2010/03/94b4_pairnetworks.png" border="0" alt="pair Networks" width="115" height="56" align="middle" /></a></td>
<td>rsync://mysql.mirrors.pair.com/mysql/</td>
<td>(Pittsburgh, PA)</td>
</tr>
<tr>
<th colspan="3">Europe</th>
</tr>
<tr>
<td><a href="http://dotsrc.org/"><img src="http://www.wenzk.com/wp-content/uploads/2010/03/f953_dotsrc.png" border="0" alt="dotSrc.org" width="145" height="34" align="middle" /></a></td>
<td>rsync://mirrors.dotsrc.org/mysql/</td>
<td>(Denmark)</td>
</tr>
<tr>
<td><a href="http://www.gwdg.de/"><img src="http://www.wenzk.com/wp-content/uploads/2010/03/5f6b_gwdg.png" border="0" alt="GWDG" width="100" height="100" align="middle" /></a></td>
<td>rsync://ftp5.gwdg.de/pub/linux/mysql/</td>
<td>(Germany)</td>
</tr>
<tr>
<td><a href="http://www.mirrorservice.org/help/introduction.html"><img src="http://www.wenzk.com/wp-content/uploads/2010/03/6d88_ukms-button-100x34.png" border="0" alt="UK Mirror Service" width="100" height="34" align="middle" /></a></td>
<td>rsync://rsync.mirrorservice.org/ftp.mysql.com/</td>
<td>(UK)</td>
</tr>
<tr>
<th colspan="3">Asia</th>
</tr>
<tr>
<td><a href="http://www.oss.eznetsols.org/">http://www.oss.eznetsols.org/</a></td>
<td>rsync://rsync.oss.eznetsols.org/ftp/mysql/</td>
<td>(Singapore)</td>
</tr>
</tbody>
</table>
</div>
<h2>Once You Set Up Your Mirror</h2>
<p>Once you have set up your mirror, please email us at <code>webmaster@mysql.com</code>, including the following information:</p>
<ul>
<li>What country (and city and state or region for larger countries) your mirror is located in.</li>
<li>The HTTP (and/or FTP) URL for your mirror.</li>
<li>The organization name you wish to be credited with providing the mirror.</li>
<li>A name and email address for someone we can contact when we notice problems with the mirrors, or send general announcements important for mirror maintainers.</li>
<li>A statement that you comply with the U.S. Export Control Laws as detailed on our <a href="http://www.sun.com/sales/its/">International Trade Services</a> page</li>
</ul>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1053" title="MySQL镜像站点">MySQL镜像站点</a> (0)</li><li><a href="http://www.wenzk.com/archives/464" title="How to build *BSD CVSup mirror">How to build *BSD CVSup mirror</a> (0)</li><li><a href="http://www.wenzk.com/archives/128" title="CPAN镜像也开始工作了">CPAN镜像也开始工作了</a> (2)</li><li><a href="http://www.wenzk.com/archives/119" title="Clamav DB 镜像站点开始工作">Clamav DB 镜像站点开始工作</a> (0)</li><li><a href="http://www.wenzk.com/archives/86" title="CentOS Mirroring HowTo">CentOS Mirroring HowTo</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/191/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

