<?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>An I.T. Problem Shared . . . &#187; MySQL</title>
	<atom:link href="http://www.moorlandit.net/index.php/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.moorlandit.net</link>
	<description>A blog of problems . . . and solutions</description>
	<lastBuildDate>Fri, 17 Jun 2011 11:25:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Losing data on MySQL SQL restore</title>
		<link>http://www.moorlandit.net/index.php/2008/09/losing-data-on-mysql-sql-restore-62?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=losing-data-on-mysql-sql-restore</link>
		<comments>http://www.moorlandit.net/index.php/2008/09/losing-data-on-mysql-sql-restore-62#comments</comments>
		<pubDate>Fri, 19 Sep 2008 15:08:28 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.moorlandit.net/?p=62</guid>
		<description><![CDATA[I recently had to backup and restore a MySQL database so I dumped the whole database into a SQL file but when I came to restore I found that in one of the biggest tables a lot of the data was missing. Looking at the warnings when I ran the restore query I found I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to backup and restore a MySQL database so I dumped the whole database into a SQL file but when I came to restore I found that in one of the biggest tables a lot of the data was missing.</p>
<p>Looking at the warnings when I ran the restore query I found I had:</p>
<p>           Error Code: 2006 &#8211; MySQL server has gone away</p>
<p>I looked up this error and it seems the MySQL server&#8217;s max_allowed_packet setting was too low compared to the size of bulk inserts that the restore file was trying to do.</p>
<p>I increased the max_allowed_packet setting to 16M and ran it again and all was well!</p>
<p>See <a href="http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html">http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html</a> for details.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moorlandit.net/index.php/2008/09/losing-data-on-mysql-sql-restore-62/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step by Step MySQL Replication</title>
		<link>http://www.moorlandit.net/index.php/2008/09/step-by-step-mysql-replication-47?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=step-by-step-mysql-replication</link>
		<comments>http://www.moorlandit.net/index.php/2008/09/step-by-step-mysql-replication-47#comments</comments>
		<pubDate>Fri, 05 Sep 2008 14:24:15 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.moorlandit.net/?p=47</guid>
		<description><![CDATA[Here&#8217;s a quick checklist on how to setup replication. http://docs.hp.com/en/5991-7432/ar01s05.html gives more information. First on the master server&#8217;s my.cnf or my.ini file comment out these lines: #skip-networking #bind-address            = 127.0.0.1 Then in the [mysqld] section add: log-bin=mysql-bin server-id=1 Then restart MySQL with /etc/init.d/mysql restart Now create a user on the master that the slave can use to [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick checklist on how to setup replication.</p>
<p><a href="http://docs.hp.com/en/5991-7432/ar01s05.html">http://docs.hp.com/en/5991-7432/ar01s05.html</a> gives more information.</p>
<p>First on the master server&#8217;s my.cnf or my.ini file comment out these lines:</p>
<blockquote><p>#skip-networking<br />
#bind-address            = 127.0.0.1</p></blockquote>
<p>Then in the [mysqld] section add:</p>
<blockquote><p>log-bin=mysql-bin</p>
<p>server-id=1</p></blockquote>
<p>Then restart MySQL with</p>
<blockquote><p>/etc/init.d/mysql restart</p></blockquote>
<p>Now create a user on the master that the slave can use to connect:</p>
<blockquote><p>GRANT REPLICATION SLAVE ON *.* TO &#8216;slave_user&#8217;@'%&#8217; IDENTIFIED BY &#8216;&lt;SOME PASSWORD&gt;&#8217;;</p>
<p>GRANT REPLICATION CLIENT ON *.* TO &#8216;slave_user&#8217;@'%&#8217;;</p></blockquote>
<p>Then get the master status with:</p>
<blockquote><p>FLUSH PRIVILEGES;</p>
<p>USE exampledb;</p>
<p>FLUSH TABLES WITH READ LOCK;</p>
<p>SHOW MASTER STATUS;</p></blockquote>
<p>Make a note of log file name and position &#8211; you&#8217;ll need it later. Then backup the master database and restore to the slave or copy it using SQLYog.</p>
<p>Then add to the slave&#8217;s my.cnf or my.ini file:</p>
<blockquote><p>server-id=2 </p></blockquote>
<p>and restart the slave MySQL server then execute:</p>
<blockquote><p>STOP SLAVE;</p>
<p>CHANGE MASTER TO </p>
<p>MASTER_HOST=&#8217;&lt;MASTER IP ADDRESS&gt;&#8217;,</p>
<p>MASTER_USER=&#8217;slave_user&#8217;,</p>
<p>MASTER_PASSWORD=&#8217;XXXXX&#8217;,</p>
<p>MASTER_LOG_FILE=&#8217;mysql-bin.000001&#8242;,</p>
<p>MASTER_LOG_POS=98;</p>
<p>START SLAVE;</p></blockquote>
<p>Sorry if this is short on detail but this is just my experience on how to get replication working, the detail can be Googled elsewhere <img src='http://www.moorlandit.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moorlandit.net/index.php/2008/09/step-by-step-mysql-replication-47/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL remote connection problems</title>
		<link>http://www.moorlandit.net/index.php/2008/09/mysql-remote-connection-problems-41?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-remote-connection-problems</link>
		<comments>http://www.moorlandit.net/index.php/2008/09/mysql-remote-connection-problems-41#comments</comments>
		<pubDate>Fri, 05 Sep 2008 09:05:19 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.moorlandit.net/?p=41</guid>
		<description><![CDATA[I&#8217;ve been experimenting with running MySQL on different operating systems and LAMP/WAMP/OAMP platforms and as I always wanted to connect to the database server from a PC on my LAN I have kept coming across connection errors. So far I&#8217;ve figured out that the following steps fix most of the connection issues. I should say [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with running MySQL on different operating systems and LAMP/WAMP/OAMP platforms and as I always wanted to connect to the database server from a PC on my LAN I have kept coming across connection errors.</p>
<p>So far I&#8217;ve figured out that the following steps fix most of the connection issues. I should say that these connection errors are not really errors but due to MySQL being locked down for security. I&#8217;m not advising anyone to take these steps on a production server until they&#8217;ve researched the implications but for me experimenting with lots of different MySQL installs safely behind my company firewall it&#8217;s a quick fix to get started.</p>
<p><strong>1. IP Binding</strong></p>
<p>Most default MySQL installs seem to lock the server down to only accept connections from the localhost 127.0.0.1 address. If you want to access the MySQL server from anywhere else you&#8217;ll have to edit this line in the my.cnf or my.ini file:</p>
<blockquote><p>bind-address=127.0.0.1</p></blockquote>
<p>I usually just enter a # at the beginning of the line for a quick and dirty fix but you might want to look into more secure options on a production server.</p>
<p><strong>2. Allowed users and hosts</strong></p>
<p>Secondly most MySQL installs only allow the root user to connect from certain hosts. The quick and dirty fix for this is to add a wildcard hosts entry for the root user. To do this at the command line type:</p>
<blockquote><p> <code>mysql --user=root mysql</code></p></blockquote>
<p>or if there is a root password try:</p>
<blockquote><p> <code>mysql --user=root --password=some_pass mysql</code></p></blockquote>
<p>Then at the mysql prompt type:</p>
<blockquote><p>mysql&gt; <code>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'</code><br />
    -&gt;     <code>IDENTIFIED BY 'some_pass' WITH GRANT OPTION;</code> </p></blockquote>
<p>That gets me remote root access on just about every installation I&#8217;ve tried so far. There are probably easier ways to do it on Windows but as most of the test rigs I&#8217;ve setup have had some flavour or Linu/BSD on them the command line was all I had!</p>
<p>If any MySQL Gurus want to comment they&#8217;re welcome &#8211; As I said these are quick solutions to get me remote access to a lot of MySQL servers I was rapidly setting up and testing with no thought to security!</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moorlandit.net/index.php/2008/09/mysql-remote-connection-problems-41/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL System Tray Monitor and Windows Vista</title>
		<link>http://www.moorlandit.net/index.php/2008/09/mysql-system-tray-monitor-and-windows-vista-35?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-system-tray-monitor-and-windows-vista</link>
		<comments>http://www.moorlandit.net/index.php/2008/09/mysql-system-tray-monitor-and-windows-vista-35#comments</comments>
		<pubDate>Tue, 02 Sep 2008 09:25:46 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.moorlandit.net/?p=35</guid>
		<description><![CDATA[I&#8217;ve installed MySQL server on Windows Vista and installed the MySQL GUI tools. I found a problem with the MySQL System Tray Monitor though &#8211; it seemed unable to stop, start or restart the MySQL service and would not allow me to save any changes I made to the MySQL instance configuration. Whenever I tried to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve installed MySQL server on Windows Vista and installed the MySQL GUI tools. I found a problem with the MySQL System Tray Monitor though &#8211; it seemed unable to stop, start or restart the MySQL service and would not allow me to save any changes I made to the MySQL instance configuration. Whenever I tried to stop the service through the system tray monitor I got the error &#8216;Could not stop service&#8217;.</p>
<p>The resolution I found was to run MySQL System Tray Monitor as Administrator &#8211; this way it has full control over the MySQL services and configuration. Problem solved!<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moorlandit.net/index.php/2008/09/mysql-system-tray-monitor-and-windows-vista-35/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

