<?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>The eflow blog &#187; mysql</title>
	<atom:link href="http://blog.eflow.org/archives/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.eflow.org</link>
	<description>Insert some amazingly witty tagline here</description>
	<lastBuildDate>Fri, 23 Apr 2010 03:19:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ignoring Foreign Key Checks in Liquibase</title>
		<link>http://blog.eflow.org/archives/143</link>
		<comments>http://blog.eflow.org/archives/143#comments</comments>
		<pubDate>Wed, 10 Feb 2010 01:17:53 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[liquibase]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=143</guid>
		<description><![CDATA[This seems fairly simple in hindsight, but I had a difficult time finding an answer to it, so I putting it down here for posterity&#8217;s sake.

 
     SET FOREIGN_KEY_CHECKS=0
 

I put this as the first changeset in a liquibase xml file.  This disables the foreign key and constraint checking in [...]]]></description>
			<content:encoded><![CDATA[<p>This seems fairly simple in hindsight, but I had a difficult time finding an answer to it, so I putting it down here for posterity&#8217;s sake.</p>
<blockquote><p>
 <changeSet author="ben" id="disable-foreign-key-checks" runAlways="true" dbms="mysql"><br />
     <sql>SET FOREIGN_KEY_CHECKS=0</sql><br />
 </changeSet>
</p></blockquote>
<p>I put this as the first changeset in a liquibase xml file.  This disables the foreign key and constraint checking in mysql. This would work for other db&#8217;s as well, but I haven&#8217;t looked up their syntax just yet.  </p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=143" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/143/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating UUID Column in the Large Obs Table</title>
		<link>http://blog.eflow.org/archives/276</link>
		<comments>http://blog.eflow.org/archives/276#comments</comments>
		<pubDate>Thu, 07 Jan 2010 15:43:04 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[uuid]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=276</guid>
		<description><![CDATA[We have well over 50 million rows in our obs table.  Using the simple &#8220;update obs set uuid = uuid() where uuid is null&#8221; would bomb out with a &#8220;The total number of locks exceeds the lock table size&#8221; error.
I ran this for a few hours to get through all rows.  (Note that [...]]]></description>
			<content:encoded><![CDATA[<p>We have well over 50 million rows in our obs table.  Using the simple &#8220;update obs set uuid = uuid() where uuid is null&#8221; would bomb out with a &#8220;The total number of locks exceeds the lock table size&#8221; error.</p>
<p>I ran this for a few hours to get through all rows.  (Note that it overwrites any uuids that are currently there)</p>
<p>Copy this into a sql script and run it with &#8220;source&#8221; in mysql at command line.</p>
<blockquote><p>
drop procedure update_uuids;<br />
delimiter //<br />
create procedure update_uuids() begin<br />
set @max = (select max(obs_id) from obs);<br />
set @x = 1;<br />
repeat<br />
set @y = @x + 100000;<br />
update obs set uuid = uuid() where obs_id >=@x and obs_id <@y;<br />
set @x = @y;<br />
until @x > @max<br />
end repeat;<br />
end<br />
//<br />
delimiter ;<br />
call update_uuids();
</p></blockquote>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=276" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/276/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenMRS Database Creation Error &#8211; Errcode 17</title>
		<link>http://blog.eflow.org/archives/268</link>
		<comments>http://blog.eflow.org/archives/268#comments</comments>
		<pubDate>Mon, 19 Oct 2009 09:12:31 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[liquibase]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[openmrs]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=268</guid>
		<description><![CDATA[A programmer here at AMPATH (Gilbert Tuwei) had some issues installing mysql.  The error message was very unhelpful and the solution was equally puzzling, so I want to put here to for the mighty google to find.
Tuwei was running v5.0.17 of MySQL.  Upgrading to version 5.1.31 made the problem disappear.
WARN &#8211; InitializationFilter$InitializationCompletion$1.run(823) &#124;2009-10-02 [...]]]></description>
			<content:encoded><![CDATA[<p>A programmer here at AMPATH (Gilbert Tuwei) had some issues installing mysql.  The error message was very unhelpful and the solution was equally puzzling, so I want to put here to for the mighty google to find.</p>
<p>Tuwei was running v5.0.17 of MySQL.  Upgrading to version 5.1.31 made the problem disappear.</p>
<blockquote><p>WARN &#8211; InitializationFilter$InitializationCompletion$1.run(823) |2009-10-02 15:24:21,000| Error while trying to update to the latest database version<br />
org.openmrs.util.DatabaseUpdateException: There was an error while updating the database to the latest. file: liquibase-update-to-latest.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::2::upul:<br />
     Reason:<br />
          java.sql.SQLException: Can&#8217;t create/write to file &#8216;C:\WINDOWS\TEMP\#sql_fe4_0.MYI&#8217; (Errcode: 17):<br />
          Caused By: Precondition Error<br />
	at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:145)<br />
	at org.openmrs.web.filter.initialization.InitializationFilter$InitializationCompletion$1.run(InitializationFilter.java:817)<br />
	at java.lang.Thread.run(Unknown Source)<br />
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase-update-to-latest.xml::2::upul:<br />
     Reason:<br />
          java.sql.SQLException: Can&#8217;t create/write to file &#8216;C:\WINDOWS\TEMP\#sql_fe4_0.MYI&#8217; (Errcode: 17):<br />
          Caused By: Precondition Error<br />
	at liquibase.ChangeSet.execute(ChangeSet.java:204)<br />
	at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:26)<br />
	at org.openmrs.util.DatabaseUpdater$1OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:177)<br />
	at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41)<br />
	at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:201)<br />
	at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:142)<br />
	&#8230; 2 more<br />
Caused by: liquibase.exception.PreconditionErrorException: Precondition Error<br />
	at liquibase.preconditions.ForeignKeyExistsPrecondition.check(ForeignKeyExistsPrecondition.java:36)<br />
	at liquibase.preconditions.NotPrecondition.check(NotPrecondition.java:18)<br />
	at liquibase.preconditions.AndPrecondition.check(AndPrecondition.java:21)<br />
	at liquibase.ChangeSet.execute(ChangeSet.java:169)<br />
	&#8230; 7 more</p></blockquote>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=268" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/268/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &#8220;Errno&#8221; Mystery Explained!</title>
		<link>http://blog.eflow.org/archives/235</link>
		<comments>http://blog.eflow.org/archives/235#comments</comments>
		<pubDate>Wed, 15 Apr 2009 19:22:32 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=235</guid>
		<description><![CDATA[One of MySQL&#8217;s biggest annoyances is the lack of descriptive error messages.  Often when dropping a table, index, foreign key you get a cryptic &#8220;errno 150 or errno152&#8243; error message. 
Well, now when you come across those simply go to the command line and type:
show engine innodb status;
Scroll up a ways and see a [...]]]></description>
			<content:encoded><![CDATA[<p>One of MySQL&#8217;s biggest annoyances is the lack of descriptive error messages.  Often when dropping a table, index, foreign key you get a cryptic &#8220;errno 150 or errno152&#8243; error message. </p>
<p>Well, now when you come across those simply go to the command line and type:</p>
<blockquote><p>show engine innodb status;</p></blockquote>
<p>Scroll up a ways and see a very helpful message about exactly which other foreign key or index is causing the blockage!  Why can&#8217;t MySQL put this information into error message to begin with??</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=235" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/235/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Default MySQL Database to InnoDB Storage Engine</title>
		<link>http://blog.eflow.org/archives/145</link>
		<comments>http://blog.eflow.org/archives/145#comments</comments>
		<pubDate>Tue, 31 Mar 2009 12:13:06 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=145</guid>
		<description><![CDATA[Currently tables created in MySQL default to MyISam.  This is unacceptable for us at Openmrs.  You can set a property in your my.cnf file called &#8220;default-storage-engine&#8221;, but I needed a solution that didn&#8217;t involve implementers having to modify their system config files.
I changed the jdbc connection url string to set a session property [...]]]></description>
			<content:encoded><![CDATA[<p>Currently tables created in <a href="http://mysql.com">MySQL</a> default to MyISam.  This is unacceptable for us at <a href="http://openmrs.org">Openmrs</a>.  You can set a property in your my.cnf file called &#8220;default-storage-engine&#8221;, but I needed a solution that didn&#8217;t involve implementers having to modify their system config files.</p>
<p>I changed the jdbc connection url string to set a session property that sets InnoDB as the default engine:</p>
<blockquote><p>jdbc:mysql://localhost:3306/databasename?autoReconnect=true&amp;sessionVariables=storage_engine=InnoDB</p></blockquote>
<p>NOTE! Requires mysql jdbc connecter version 3.1.18 or greater.  See http://dev.mysql.com/doc/refman/5.0/en/connector-j.html for documentation and then http://dev.mysql.com/downloads/connector/j/ to download.</p>
<p>The error message I was getting before upgrading the mysql jdbc connector was:</p>
<blockquote><p>java.sql.SQLException: Server connection failure during transaction. Due to underlying exception: &#8216;java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#8221; at line 1&#8242;.</p>
<p>** BEGIN NESTED EXCEPTION **</p>
<p>java.sql.SQLException<br />
MESSAGE: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#8221; at line 1</p>
<p>STACKTRACE:</p>
<p>java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#8221; at line 1<br />
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)<br />
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)<br />
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)<br />
at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)<br />
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)<br />
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:929)<br />
at com.mysql.jdbc.Connection.setSessionVariables(Connection.java:5077)<br />
at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3680)<br />
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2684)<br />
at com.mysql.jdbc.Connection.&lt;init&gt;(Connection.java:1474)<br />
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264)<br />
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)<br />
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)<br />
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)<br />
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)<br />
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)<br />
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)<br />
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)<br />
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)</p></blockquote>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=145" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/145/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation troubles with MySQLdb-python</title>
		<link>http://blog.eflow.org/archives/54</link>
		<comments>http://blog.eflow.org/archives/54#comments</comments>
		<pubDate>Thu, 29 May 2008 18:34:03 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=54</guid>
		<description><![CDATA[I&#8217;m in the middle of moving OpenMRS&#8217;s web presence from a shared virtual machine to a new dedicated box.  The only trouble I ran into was with the mysql python module (again).
For posterity&#8217;s sake, I&#8217;m going to write my solution here.
easy_install mysql-python
I received this error when trying to install the MySQLdb-python module into python on [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the middle of moving OpenMRS&#8217;s web presence from a shared virtual machine to a new dedicated box.  The only trouble I ran into was with the mysql python module (again).</p>
<p>For posterity&#8217;s sake, I&#8217;m going to write my solution here.</p>
<blockquote><p>easy_install mysql-python</p></blockquote>
<p>I received this error when trying to install the MySQLdb-python module into python on centOS:</p>
<blockquote><p>_mysql.c:2808: error: expected declaration specifiers before ‘init_mysql’<br />
_mysql.c:2886: error: expected ‘{’ at end of input<br />
error: Setup script exited with error: command &#8216;gcc&#8217; failed with exit status 1</p></blockquote>
<p>The fix I remembered.  I just had to install the python development packages:</p>
<blockquote><p>yum install python-devel</p></blockquote>
<p>I then had another very odd and strangely familiar error:</p>
<blockquote><p>In file included from _mysql.c:35:<br />
/usr/include/mysql/my_config.h:15:28: error: my_config_i386.h: No such file or directory<br />
error: command &#8216;gcc&#8217; failed with exit status 1</p></blockquote>
<p>Googling around gave me nothing helpful&#8230;in fact the results looked strangely familiar as well.  I couldn&#8217;t remember the solution to this one though.</p>
<p>Eventually, I actually <em>read</em> the error message and realized that our new vm isn&#8217;t an x64 box.  For some reason there was a my_config_x64.h file in /usr/include/mysql but there wasn&#8217;t a <a href="http://blog.eflow.org/wp-content/uploads/2008/06/my_config_i386.h">my_config_i386.h</a>.  Luckily, that file <em>was</em> present on the old server. <strong>Copying that file from /usr/include/mysql on the old box to the new was the cure.</strong></p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=54" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/54/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Speeding up OpenMRS with KickFire</title>
		<link>http://blog.eflow.org/archives/29</link>
		<comments>http://blog.eflow.org/archives/29#comments</comments>
		<pubDate>Thu, 17 Apr 2008 22:04:20 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[kickfire]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqlconf2008]]></category>

		<guid isPermaLink="false">http://eflow.org/blog/archives/29</guid>
		<description><![CDATA[A new company named Kickfire launched at the MySQL 2008 Conference.  Their product is a rackmounted server intended to be used as a high-end database (and server, if need be).  Their innovation is a cpu specific to sql commands: the &#8220;SQL chip&#8221;.   It works in similar fashion to a graphics specific [...]]]></description>
			<content:encoded><![CDATA[<p align="left">A new company named <a href="http://kickfire.com/">Kickfire</a> launched at the <a href="http://mysqlconf.com">MySQL 2008 Conference</a>.  <a href="http://kickfire.com"><img style="padding: 5px" src="http://blog.eflow.org/wp-content/uploads/2008/04/kickfire.gif" border="0" alt="Kickfire Logo" align="right" /></a>Their product is a rackmounted server intended to be used as a high-end database (and server, if need be).  Their innovation is a cpu specific to sql commands: the &#8220;SQL chip&#8221;.   It works in similar fashion to a graphics specific cpu or router cpu.  Instead of taking in the normal assembly commands, the sql chip understands 10 or so sql type of commands: insert, update, join, etc.   This change drops the number of commands being run on the chip by leaps and bounds.  There are a few other changes they make, but you can learn those in their video.  They claim there is a 10x decrease in query time.</p>
<p>Kickfire is currently in beta.  If you would like to join the beta program, I can put you in touch with the right people.  Unfortunately, all beta boxes will be returned to Kickfire.  Fortunately, OpenMRS implementers may have an opportunity at that point for a discounted machine.  If you&#8217;re looking into buying a high end server, you definitely want to add the Kickfire box to your list of options.</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=29" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bending Connector/J to Our Liking</title>
		<link>http://blog.eflow.org/archives/28</link>
		<comments>http://blog.eflow.org/archives/28#comments</comments>
		<pubDate>Wed, 16 Apr 2008 22:55:40 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqlconf2008]]></category>

		<guid isPermaLink="false">http://eflow.org/blog/archives/28</guid>
		<description><![CDATA[I attended a session today at the MySQLConf2008 by Mark Matthews on adding extensions to the mysql jdbc connector.  There are some exciting implications as an alternative to the BIRT ODA Plugin project.  The idea of that project is to create a series of REST calls to only require the end user of [...]]]></description>
			<content:encoded><![CDATA[<p>I attended a <a href="http://en.oreilly.com/mysql2008/public/schedule/detail/248">session</a> today at the <a href="http://www.mysqlconf.com">MySQLConf2008</a> by <a href="http://en.oreilly.com/mysql2008/public/schedule/speaker/144">Mark Matthews</a> on adding extensions to the mysql jdbc connector.  There are some exciting implications as an alternative to the <a href="http://openmrs.org/wiki/Projects#Extend_OpenMRS_ODA_Plugin">BIRT ODA Plugin</a> project.  The idea of that project is to create a series of REST calls to only require the end user of the BIRT reporting application to have a high level knowledge of OpenMRS objects (instead of low level knowledge of the OpenMRS data model).</p>
<p>Sometime last year <a href="http://burkeware.com/blog/">Burke</a> laid out his dream BIRT (or other reporting frameworks) connection. It entailed writing a custom jdbc connector that didn&#8217;t act on the database, but instead acted on our API.  The &#8220;available tables&#8221; as the user would see it in BIRT would actually be a subset of our higher level Java objects.</p>
<p>In the session Mark discussed the new intercept-ability of the <a href="http://www.mysql.com/products/connector/j/">MySQL Connector/J</a> (new in version 5.1ga of the connector).  The relevant/interesting addition to the connector is the &#8220;statement interceptor&#8221;.  We could use this to intercept the select calls from BIRT that look like &#8220;SELECT AGE, GENDER, WEIGHT, HEIGHT, LATEST CD4  FROM PATIENT WHERE DATE &gt; 1/1/2008&#8243;.  These calls could be turned into some LogicService calls on AGE, WEIGHT, LATEST CD4, etc to get the ResultSet instead of passing that (unusable) query to mysql.  The LogicService&#8217;s resultSet could then be returned to BIRT for display as a data set.  There isn&#8217;t any documentation on <a href="http://forge.mysql.com">MySQL Forge</a> on how this would work yet.  Mark&#8217;s slides should show up as an option on the <a href="http://forge.mysql.com/wiki/MySQLConf2008WednesdayNotes">mysqlconf&#8217;s wiki</a> soon though.</p>
<p>Side note: The jdbc driver&#8217;s version number does not match with the mysql version numbers.  Version 5.1 of the driver can be used with the current 5.0 of MySQL.</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=28" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/28/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenMRS Replication for Dummies</title>
		<link>http://blog.eflow.org/archives/30</link>
		<comments>http://blog.eflow.org/archives/30#comments</comments>
		<pubDate>Tue, 15 Apr 2008 22:56:52 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqlconf2008]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://eflow.org/blog/archives/30</guid>
		<description><![CDATA[Patrick Galbraith presented gave an interesting presention titled &#8220;Replication for Dummies&#8221; at the MySQL Conference today. Previously, I had the notion that replicating servers and creating a master/slave MySQL setup was difficult.  However, Patrick had a master/slave, then dual master, then dual master with a slave attached running in under 20 mins.  He [...]]]></description>
			<content:encoded><![CDATA[<p>Patrick Galbraith presented gave an interesting presention titled <a href="http://en.oreilly.com/mysql2008/public/schedule/detail/1099">&#8220;Replication for Dummies&#8221;</a> at the <a href="http://www.mysqlconf.com">MySQL Conference</a> today. Previously, I had the notion that replicating servers and creating a master/slave MySQL setup was difficult.  However, Patrick had a master/slave, then dual master, then dual master with a slave attached running in under 20 mins.  He stepped through the my.cnf properties required for both the master server and the slave server &#8212; less than 10 for each!</p>
<p>The gist of how replication works is this:</p>
<ol>
<li>The master server writes all insert/update statements to a log file while applying them to itself.</li>
<li>The slave server knows about this log file and simply applies each insert/update to itself.</li>
<li>The slave server keeps track of where in the binlog file it last read from, so if the slave goes offline, it can start again from its exact position to get up-to-date.</li>
</ol>
<p>It doesn&#8217;t seem like Patrick has his notes on the <a href="http://forge.mysql.com/wiki/MySQL_Conference_and_Expo_2008">MySQLConf2008 wiki</a> yet, but <a href="http://mckowsay.blogspot.com/">Brian</a> found a nice easy <a href="http://howtoforge.com/mysql_database_replication">replication howto</a> we can follow instead.  I look forward to setting this up for AMPATH and pointing all of our data managers&#8217; read requests to the slave database instead of wasting cycles on the main master database.  (that is royal &#8220;I&#8221; and will actually be either Brian or Simiyu <img src='http://blog.eflow.org/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> )</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=30" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/30/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
