<?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>Anchor Web Hosting Blog &#187; mysql</title>
	<atom:link href="http://www.anchor.com.au/blog/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anchor.com.au/blog</link>
	<description>A view into the Anchor Engineroom</description>
	<lastBuildDate>Wed, 08 Feb 2012 00:51: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>Performance tips &#8211; good reading for PHP/mysql devs</title>
		<link>http://www.anchor.com.au/blog/2009/10/performance-tips-good-reading-for-phpmysql-devs/</link>
		<comments>http://www.anchor.com.au/blog/2009/10/performance-tips-good-reading-for-phpmysql-devs/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 13:56:26 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[FTW]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[scaling]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=1032</guid>
		<description><![CDATA[I came across this a little while ago; it&#8217;s a good little presentation with some interesting points I&#8217;d not considered before. http://www.slideshare.net/techdude/how-to-kill-mysql-performance If you&#8217;re an Anchor customer, I should point out that the ARCHIVE storage engine isn&#8217;t available in Redhat&#8217;s version of MySQL, which is a damned nuisance.]]></description>
			<content:encoded><![CDATA[<p>I came across this a little while ago; it&#8217;s a good little presentation with some interesting points I&#8217;d not considered before.</p>
<p><a href="http://www.slideshare.net/techdude/how-to-kill-mysql-performance">http://www.slideshare.net/techdude/how-to-kill-mysql-performance</a></p>
<p>If you&#8217;re an Anchor customer, I should point out that the ARCHIVE storage engine isn&#8217;t available in Redhat&#8217;s version of MySQL, which is a damned nuisance. <img src='http://www.anchor.com.au/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2009/10/performance-tips-good-reading-for-phpmysql-devs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple MySQL Relational Database</title>
		<link>http://www.anchor.com.au/blog/2009/04/a-simple-mysql-relational-database/</link>
		<comments>http://www.anchor.com.au/blog/2009/04/a-simple-mysql-relational-database/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 06:36:02 +0000</pubDate>
		<dc:creator>Phillip Pace</dc:creator>
				<category><![CDATA[FTW]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql database]]></category>
		<category><![CDATA[relational database]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=839</guid>
		<description><![CDATA[I&#8217;ve searched far a wide and all I wanted is a MySQL database schema that incorporated all the common relationships that tie into a relational database i.e one to one, one to many and many to many but haven&#8217;t had much luck. So here you go a straight to the point post that will give [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve searched far a wide and all I wanted is a MySQL database schema that incorporated all the common relationships that tie into a relational database i.e one to one, one to many and many to many but haven&#8217;t had much luck.</p>
<p>So here you go a straight to the point post that will give you:</p>
<ul>
<li>a fully functional MySQL databse schema along with inserted dummy data</li>
<li>a relational database with common relationships such as one to one, one to many and many to many</li>
<li>a list of example select queries to use to see how you can create table joins between tables</li>
</ul>
<p>To download the database please <a href="http://anchor.com.au/hosting/support/CreatingAQuickMySQLRelationalDatabase?action=AttachFile&amp;do=get&amp;target=dump.sql">click here</a></p>
<p><strong>Diagram Of The Database</strong><br />
The following diagram will help give you a good visual of all the tables in the database and what relationships are in place:</p>
<p style="text-align: center;"><a href="http://www.anchor.com.au/blog/wp-content/uploads/2009/04/dog-er.jpeg"><img class="aligncenter size-medium wp-image-851" title="dog-er diagram" src="http://www.anchor.com.au/blog/wp-content/uploads/2009/04/dog-er-300x224.jpg" alt="dog-er diagram" width="300" height="224" /></a></p>
<p><strong>Select Queries </strong><br />
So you have got all your information in different tables (relational database) and you need to perform table joins. Below are a list of the most common types of table joins using the different relationship types one-to-one, one-to-many and many-to-many:</p>
<p><em>One-To-One</em><br />
<code><br />
SELECT dog.id, dog.name, rfid_dog.bar_code AS rfid<br />
FROM dog,rfid_dog<br />
WHERE dog.id = rfid_dog.dog_id<br />
ORDER BY dog.name ASC;<br />
</code></p>
<p><em>One-To-Many</em><br />
<code><br />
SELECT dog.id,dog.name,breed.name AS breed<br />
FROM dog,breed<br />
WHERE dog.breed_id = breed.id<br />
ORDER BY dog.name ASC;<br />
</code></p>
<p><em>Many-To-Many</em><br />
<code><br />
SELECT breeder.name,breeder.address,breeder.phone,breeder.email,breed.name AS breedName<br />
FROM breed,breeder,breed__breeder<br />
WHERE breed__breeder.breed_id = breed.id<br />
AND breed__breeder.breeder_id = breeder.id<br />
ORDER BY breeder.name ASC;<br />
</code></p>
<p>And just like that you now have your head around relational databases!</p>
<p>If you have come to this point and your still excited and want to learn more <a href="http://www.anchor.com.au/hosting/support/CreatingAQuickMySQLRelationalDatabase">please see our wiki article</a> which goes into more detail about relational databases plus talks about optimisation techniques to speed things up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2009/04/a-simple-mysql-relational-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title># mysql_secure_installation&#8230; Ya-ha-! (and ~/.my.cnf)</title>
		<link>http://www.anchor.com.au/blog/2009/03/mysql_secure_installation-ya-ha-and-mycnf/</link>
		<comments>http://www.anchor.com.au/blog/2009/03/mysql_secure_installation-ya-ha-and-mycnf/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 03:19:33 +0000</pubDate>
		<dc:creator>Barney Desmond</dc:creator>
				<category><![CDATA[WTF]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql_secure_installation]]></category>
		<category><![CDATA[option file]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.anchor.com.au/blog/?p=634</guid>
		<description><![CDATA[I was setting up mysql-server for a customer recently and noticed something interesting &#8211; there&#8217;s a helpful script included with mysql called mysql_secure_installation. We thought about that for a moment and had a chuckle. Okay, that was a little unfair; it&#8217;s no secret that we prefer to use Postgres wherever possible, but the idea of [...]]]></description>
			<content:encoded><![CDATA[<p>I was setting up mysql-server for a customer recently and noticed something interesting &#8211; there&#8217;s a helpful script included with mysql called <code>mysql_secure_installation</code>. We thought about that for a moment and had a chuckle. Okay, that was a little unfair; it&#8217;s <a href="http://www.anchor.com.au/hosting/dedicated/mysql_vs_postgres">no secret that we prefer to use Postgres</a> wherever possible, but the idea of having a &#8220;make it all secure&#8221; script isn&#8217;t too bad an idea, as long as it doesn&#8217;t produce a false sense of security.</p>
<p><span id="more-634"></span></p>
<p>The script does good things, but MySQL could probably be doing things better to begin with &#8211; make it more secure out-of-the-box, and the <strong>last</strong> thing they should be doing is shipping it with an empty root password. &gt;_&lt; It pains me to say it, but I think MSSQL probably comes with a more-secure initial configuration. Things like no remote connections, and no test database unless you explicitly ask for it.</p>
<p>The <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-secure-installation.html">documentation for <code>mysql_secure_installation</code></a> is brief but functional. One of the things I thought it was doing was writing out a convenient .my.cnf file for the user, but it turns out it just deletes it once it&#8217;s finished. This is a shame, because the per-user config file is really cool.</p>
<p>If you&#8217;re not already taking advantage of them, you should. <a href="http://dev.mysql.com/doc/refman/5.0/en/option-files.html">MySQL calls them &#8220;option files&#8221;</a>, and it lets you set default parameters for the client apps you use at the command line, like <code>mysql</code> and <code>mysqldump</code>, etc. We use them to store root&#8217;s login credentials so we don&#8217;t have to lookup the password for a given machine, then mess around with mysql&#8217;s asinine option-handling.</p>
<p>It&#8217;s best to at least read up briefly on option files before using them, but they&#8217;re pretty straightforward: you have &#8220;groups&#8221; of options in the file written as <code>[groupname]</code>, then one option on each line after that. An instructive example:</p>
<blockquote><p><code>[mysql]<br />
database=mysql<br />
</code></p>
<p><code><br />
[client]<br />
user=root<br />
password=verySecurePassword<br />
</code></p></blockquote>
<p>If you&#8217;re going to keep your password here, you <strong>must</strong> make sure the file is adequately protected from other users who might try to view it.</p>
<p>The group-names I mentioned correspond to the client program that will use the options. <code>[client]</code> is a special case; those options will be used by all the mysql client programs, so it&#8217;s the ideal place for your username and password.</p>
<p>Having the database option in the <code>[mysql]</code> group means you&#8217;re automatically connected to a database once you start the mysql command-line client. We don&#8217;t put this in the <code>[client]</code> group because it would affect other utilities like <code>mysqldump</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.anchor.com.au/blog/2009/03/mysql_secure_installation-ya-ha-and-mycnf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

