<?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/tags/mysql/</link>
    <description>Recent content in MySQL on Ricky Moorhouse</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Wed, 15 Sep 2010 15:17:56 +0000</lastBuildDate>
    <atom:link href="https://rickymoorhouse.uk/tags/mysql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>MySQL Locking</title>
      <link>https://rickymoorhouse.uk/blog/2010/mysql-locking/</link>
      <pubDate>Wed, 15 Sep 2010 15:17:56 +0000</pubDate>
      <guid>https://rickymoorhouse.uk/blog/2010/mysql-locking/</guid>
      <description>&lt;p&gt;After experimenting a bit with MySQL locking today, I thought I&#39;d make a note of what I&#39;d discovered:&lt;/p&gt;&#xA;&lt;p&gt;To create a lock, you need to use:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;code&amp;gt;LOCK TABLES table1 [READ |WRITE], table2 [READ |WRITE]&amp;lt;/code&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;READ is used to stop other people changing the table while you read from it.&#xA;WRITE is used to stop other people reading the table while you write to it.&lt;/p&gt;&#xA;&lt;p&gt;Once you have issued a &lt;code&gt;LOCK TABLES&lt;/code&gt; statement, you will not have access to any tables you didn&#39;t include.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Recover from &#34;Failed to open the relay log&#34;</title>
      <link>https://rickymoorhouse.uk/blog/2010/recover-from-failed-to-open-the-relay-log/</link>
      <pubDate>Mon, 06 Sep 2010 14:17:12 +0000</pubDate>
      <guid>https://rickymoorhouse.uk/blog/2010/recover-from-failed-to-open-the-relay-log/</guid>
      <description>&lt;p&gt;If you find that after rebooting your MySQL slave it stops replicating with the master and you see the &amp;quot;Failed to open the relay log&amp;quot; error in the logs it is probably caused by MySQL putting it&#39;s relay logs in /var/run by default, which gets cleared out on boot.&lt;/p&gt;&#xA;&lt;p&gt;To fix this, you need to change the location MySQL uses for the logging by adding the following line to the [mysqld] section of /etc/my.cnf&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL Log Rotation</title>
      <link>https://rickymoorhouse.uk/blog/2008/mysql-log-rotation/</link>
      <pubDate>Thu, 29 May 2008 15:08:27 +0000</pubDate>
      <guid>https://rickymoorhouse.uk/blog/2008/mysql-log-rotation/</guid>
      <description>&lt;p&gt;Make sure that expire_logs_days is set to ensure that log rotation takes place&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
