<?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>PMA Media Group&#187; mysql sync</title>
	<atom:link href="http://www.pmamediagroup.com/tag/mysql-sync/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pmamediagroup.com</link>
	<description>Unique Marketing Techniques and Strategies with Guaranteed Results!</description>
	<lastBuildDate>Fri, 27 Aug 2010 18:14:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Database syncronization woes</title>
		<link>http://www.pmamediagroup.com/2009/11/database-syncronization-woes/</link>
		<comments>http://www.pmamediagroup.com/2009/11/database-syncronization-woes/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 00:00:50 +0000</pubDate>
		<dc:creator>Narshlob</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[database replication]]></category>
		<category><![CDATA[database syncronization]]></category>
		<category><![CDATA[mysql replication]]></category>
		<category><![CDATA[mysql sync]]></category>

		<guid isPermaLink="false">http://www.pmamediagroup.com/?p=978</guid>
		<description><![CDATA[Database resyncronization depends on what went wrong but the steps below will most likely solve most issues.
Run these commands on the slave database

STOP SLAVE; # stop the Slave I/O threads
RESET SLAVE; # forget about all the relay log files

Then go to the master database and run these

RESET MASTER; # reset the bin log counter and [...]]]></description>
			<content:encoded><![CDATA[<p>Database resyncronization depends on what went wrong but the steps below will most likely solve most issues.<br />
Run these commands on the slave database</p>
<ol>
<li>STOP SLAVE; # stop the Slave I/O threads</li>
<li>RESET SLAVE; # forget about all the relay log files</li>
</ol>
<p>Then go to the master database and run these</p>
<ol>
<li>RESET MASTER; # reset the bin log counter and wipe out bin log files
<li>FLUSH TABLES WITH READ LOCK; # flush buffers and LOCK tables
<li>show master status\G
</ol>
<p>Note what the show master status command returns. You&#8217;ll need to know the file name and the position.<br />
You can do one of two things here, make a dump of the entire master database (in which case I suggest you follow <a href="http://blog.gurudelleccelsopicco.org/2009/09/howto-mysql-master-slave-resync/">this</a>)<br />
or you can just update the tables.<br />
Usually we just need to update the tables so release the lock on the master database tables (UNLOCK TABLES;) and then run this command on the slave database (download maatkit tools <a href="http://code.google.com/p/maatkit/downloads/list">here</a>),</p>
<ul>
<li>cd ~/maatkit-5014/bin &#038;&#038; sudo ./mk-table-sync &#8211;[print][execute] u=[user],p=[pass],h=[master_host_name] &#8211;databases [database_name(s)] localhost</li>
</ul>
<p>I suggest you run &#8211;print before you run &#8211;execute. If you run &#8211;execute first, you have no idea what just happened. &#8211;print will let you know what it&#8217;ll do without actually doing anything.<br />
Back to the slave database mysql client, issue these commands,</p>
<ol>
<li>CHANGE MASTER TO MASTER_LOG_FILE=&#8217;[file name from show master status command]&#8216;, MASTER_LOG_POS=[pos];</p>
<li>SLAVE START;</ol>
<p>Run this command,</p>
<ul>
<li>show slave status\G</li>
</ul>
<p>And check that these aren&#8217;t NO or NULL,</p>
<p>Slave_IO_Running: Yes<br />
Slave_SQL_Running: Yes<br />
&#8230;.<br />
Seconds_Behind_Master: 1634</p>
<p>If things aren&#8217;t back to normal, follow the instructions on <a href="http://blog.gurudelleccelsopicco.org/2009/09/howto-mysql-master-slave-resync/">this website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pmamediagroup.com/2009/11/database-syncronization-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.pmamediagroup.com @ 2012-02-08 16:36:42 -->
