<?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>tom's blog &#187; Databases</title>
	<atom:link href="http://tom.knaupp.com/category/databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://tom.knaupp.com</link>
	<description>free software, security and a bunch of my strange thoughts</description>
	<lastBuildDate>Tue, 23 Mar 2010 22:38:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MySQL Replication Failed</title>
		<link>http://tom.knaupp.com/2009/04/26/mysql-replication-failed/</link>
		<comments>http://tom.knaupp.com/2009/04/26/mysql-replication-failed/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 12:40:28 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Distributions]]></category>
		<category><![CDATA[duplicate entry]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://tom.knaupp.com/?p=265</guid>
		<description><![CDATA[I wanted to replicate a MySQL-Database using the integrated Master -> Slave mechanism. Master-System: &#160;&#160;openSUSE 10.2, MySQL 5.0.26 The Slave-Setup: openSUSE 11.1, MySQL 5.0.67 This is quite easy to setup usually. This time, I almost had a nervous breakdown. On the slave side the replication just didn&#8217;t start. The logfile showed these errors: 090421 20:49:28 [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to replicate a MySQL-Database using the integrated Master -> Slave mechanism.<br />
<br />
Master-System: &nbsp;&nbsp;openSUSE 10.2, MySQL 5.0.26<br />
The Slave-Setup: openSUSE 11.1, MySQL 5.0.67<br />
<br />
This is quite easy to setup usually. This time, I almost had a nervous breakdown.<br />
On the slave side the replication just didn&#8217;t start. The logfile showed these errors:<br />
<code><br />
090421 20:49:28 [ERROR] Slave: Error 'Duplicate entry '790233' for key 1' on query.<br />
...<br />
090421 20:49:28 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000008' position 30408893<br />
</code><br />
<br />
As checking the database and making sure that there were no &#8220;duplicate entries&#8221;,<br />
did not bring up any results, I found something curious (after hours and hours).<br />
<br />
On the Master-System:<br />
<br />
<code><font face="Courier New, Courier">mysql> SHOW MASTER STATUS;<br />
+- - - - - - - - + - - - - - + - - - - - - - + - - - - - - - - -+<br />
| File &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Position &nbsp;| Binlog_Do_DB &nbsp;| Binlog_Ignore_DB |<br />
+- - - - - - - - + - - - - - + - - - - - - - + - - - - - - - - -+<br />
| mysql-bin.0001 | &nbsp;&nbsp;&nbsp;10034 &nbsp;| mydb,mydb &nbsp;&nbsp;&nbsp;&nbsp;| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
+- - - - - - - - + - - - - - + - - - - - - - + - - - - - - - - -+<br />
</font></code><br />
Why is the database listed two times? In the configuration it&#8217;s only used one time:<br />
&nbsp;<br />
<code>binlog-do-db = mydb</code><br />
<br />&nbsp;<br />
After spending some time on google, I found the reason:<br />
<a href="http://bugs.mysql.com/bug.php?id=20748">http://bugs.mysql.com/bug.php?id=20748</a><br />
It&#8217;s a bug : /  MySQL (in that version) is reading the configuration file twice.<br />
&nbsp;<br />
If installing a newer version is not possible, you can use this workaround:<br />
Start MySQL with the option <code>--defaults-file=/etc/my.cnf</code><br />
This advices MySQL to ONLY use this config file.</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.knaupp.com/2009/04/26/mysql-replication-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increase MySQL Performance</title>
		<link>http://tom.knaupp.com/2007/05/14/increase-mysql-performance/</link>
		<comments>http://tom.knaupp.com/2007/05/14/increase-mysql-performance/#comments</comments>
		<pubDate>Mon, 14 May 2007 18:11:29 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://tom.knaupp.com/2007/05/14/increase-mysql-performance/</guid>
		<description><![CDATA[Keyword: MySQL Query Cache If you want to increase the speed of your MySQL Database (answers), think about activating the Query Cache. That is available since Version 4. It&#8217;s really recommendable when you are working a lot with dynamic generated content, that does not change too often. Usually that is the fact for most webservers. [...]]]></description>
			<content:encoded><![CDATA[<p>Keyword: <a href="http://dev.mysql.com/doc/refman/5.0/en/query-cache.html" title="MySQL 5.0 Reference Manual" target="_blank">MySQL Query Cache</a><br />
<br />
If you want to increase the speed of your MySQL Database (answers), think about activating the Query Cache. That is available since Version 4. It&#8217;s really recommendable when you are working a lot with dynamic generated content, that does not change too often. Usually that is the fact for most webservers. In that case the Query Cache will give you back the answers for your sql queries <em>without polling the database</em> &#8211; as long as the tables do not change.<br />
<br />
Insert in your config (/etc/my.cnf) i.e.:<br />
<code>query_cache_size = 8M</code><br />
<br />
You can control the usage with a sql query:<br />
<code>SHOW STATUS LIKE 'Qcache%';</code><br />
<br />
Thanks to <a href="http://www.schefter.net/deutsch/techtalk/mysql_performance.html" title="schefter.net / MySQL Performance-Tipps" target="_blank">Thomas Schefter</a> for the hint.</p>
]]></content:encoded>
			<wfw:commentRss>http://tom.knaupp.com/2007/05/14/increase-mysql-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
