<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>MySQL on Ricky Moorhouse</title>
    <link>https://rickymoorhouse.uk/categories/mysql/</link>
    <description>Recent content in MySQL on Ricky Moorhouse</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Tue, 26 Jul 2011 12:32:52 +0000</lastBuildDate>
    <atom:link href="https://rickymoorhouse.uk/categories/mysql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>MySQL: From multi-master to circular replication</title>
      <link>https://rickymoorhouse.uk/blog/2011/mysql-from-multi-master-to-circular-replication/</link>
      <pubDate>Tue, 26 Jul 2011 12:32:52 +0000</pubDate>
      <guid>https://rickymoorhouse.uk/blog/2011/mysql-from-multi-master-to-circular-replication/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Disable anything that will write to the database&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Update the my.cnf files for all servers to support circular replication, by adding log-slave-updates and ensuring you have unique server ids and the auto increment values are suitable. Then restart mysql to pick up the config changes.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Ensure your existing replication is up-to-date using:&#xA;&lt;code&gt;SHOW SLAVE STATUS&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Stop replication on both existing servers using&#xA;&lt;code&gt;STOP SLAVE&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create a backup of the database from the server that will be just before your new server in the circle using:&#xA;&lt;code&gt;mysqldump --master-data=1 -a -c -Q {db} &amp;gt;  {filename} &lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sort by Surname</title>
      <link>https://rickymoorhouse.uk/blog/2011/sort-by-surname/</link>
      <pubDate>Tue, 07 Jun 2011 13:36:24 +0000</pubDate>
      <guid>https://rickymoorhouse.uk/blog/2011/sort-by-surname/</guid>
      <description>&lt;p&gt;&lt;code&gt;ORDER BY SUBSTRING_INDEX(full_name, &#39; &#39;, -1)&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Load CSV data into MySQL</title>
      <link>https://rickymoorhouse.uk/blog/2010/load-csv-data-into-mysql/</link>
      <pubDate>Tue, 12 Jan 2010 11:20:58 +0000</pubDate>
      <guid>https://rickymoorhouse.uk/blog/2010/load-csv-data-into-mysql/</guid>
      <description>&lt;code&gt;&#xA;    load data local infile &#39;&lt;em&gt;export.csv&lt;/em&gt;&#39; into table &lt;em&gt;table_name&lt;/em&gt;&#xA;    fields terminated by &#39;,&#39;&#xA;    enclosed by &#39;&#34;&#39;&#xA;    lines terminated by &#39;n&#39;&#xA;    (&lt;em&gt;field_list&lt;/em&gt;)&#xA;    &lt;/code&gt;</description>
    </item>
    <item>
      <title>Useful SQL</title>
      <link>https://rickymoorhouse.uk/blog/2009/useful-sql/</link>
      <pubDate>Thu, 15 Oct 2009 09:00:11 +0000</pubDate>
      <guid>https://rickymoorhouse.uk/blog/2009/useful-sql/</guid>
      <description>&lt;p&gt;update [table_name] set [field_name] = replace([field_name], &#39;[string_to_find]&#39;, &#39;[string_to_replace]&#39;);&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Replace within a field&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
  </channel>
</rss>
