<?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; replication</title>
	<atom:link href="http://tom.knaupp.com/tag/replication/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>Fri, 21 Jan 2011 00:13:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</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>
	</channel>
</rss>

