<?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; mysql</title>
	<atom:link href="http://tom.knaupp.com/tag/mysql/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>PAM-Authentication &amp; MySQL (v5) / b1gMail</title>
		<link>http://tom.knaupp.com/2007/03/15/pam-authentication-mysql-v5/</link>
		<comments>http://tom.knaupp.com/2007/03/15/pam-authentication-mysql-v5/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 15:46:23 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[Mailserver]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[old_password]]></category>
		<category><![CDATA[pam auth]]></category>
		<category><![CDATA[pam authentication]]></category>

		<guid isPermaLink="false">http://tom.knaupp.com/?p=29</guid>
		<description><![CDATA[Enviroment: SuSE Linux 10.1 pam-0.99.3.0-29.3, pam-modules-10.1-7 postfix-2.2.9-10 mysql-5.0.18-20.8, mysql-client-5.0.18-16 I was trying to implement SASL-authentication via PAM (which is using a mysql-backend) in a postfix installation. Output from maillog: postfix/smtpd: warning: SASL authentication failure: Password verification failed postfix/smtpd: warning: [x.x.x.x]: SASL PLAIN authentication failed Checking the syslog: saslauthd: pam_b1gmail: cannot connect to mysql database (Access [...]]]></description>
			<content:encoded><![CDATA[<p>Enviroment:</p>
<ul>
<li>SuSE Linux 10.1
<ul>
<li>pam-0.99.3.0-29.3, pam-modules-10.1-7</li>
</ul>
<ul>
<li>postfix-2.2.9-10</li>
</ul>
<ul>
<li>mysql-5.0.18-20.8, mysql-client-5.0.18-16</li>
</ul>
</li>
</ul>
<p>I was trying to implement SASL-authentication via PAM (which is using a mysql-backend) in a postfix installation.<br />
Output from maillog:<br />
<br />
<code>postfix/smtpd: warning: SASL authentication failure: Password verification failed<br />
postfix/smtpd: warning: [x.x.x.x]: SASL PLAIN authentication failed</code><br />
<br />
Checking the syslog:<br />
<br />
<code>saslauthd: pam_b1gmail: cannot connect to mysql database<br />
(Access denied for user 'xx'@'localhost' (using password: YES))<br />
saslauthd: DEBUG: auth_pam: pam_authenticate failed: Permission denied<br />
saslauthd: do_auth : auth failure: [user=xx] [service=smtp]<br />
[realm=domain.tld] [mech=pam] [reason=PAM auth error]</code><br />
<br />
Reason:<br />
The PAM module is using a deprecated way to connect to the MySQL-DB.<br />
<br />
Solution:<br />
Set the MySQL-Password to OLD_PASSWORD:<br />
<br />
<code>SET PASSWORD FOR user'@'localhost' = OLD_PASSWORD('password');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://tom.knaupp.com/2007/03/15/pam-authentication-mysql-v5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
